/* 
 * Pan Comido - Admin Dashboard Styles
 */

:root {
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --card-bg: #ffffff;
    --bg-color: #f8fafc;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-light: #64748b;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: #1e293b;
        --bg-color: #0f172a;
        --border: #334155;
        --text-main: #f8fafc;
        --text-light: #94a3b8;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
}

.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.sidebar-sub {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 32px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #94a3b8;
    border-radius: 12px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 16px;
}

.nav-item:hover,
.nav-item.active {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), transparent);
    color: var(--primary);
}

.main-content {
    margin-left: 260px;
    padding: 32px;
    flex: 1;
    min-width: 0;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.dash-title {
    font-size: 28px;
    font-weight: 700;
}

.dash-date {
    color: var(--text-light);
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
}

.stat-card.primary .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

.stat-highlight {
    font-size: 14px;
    margin-top: 4px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 14px;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: rgba(var(--primary), 0.02);
}

.status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--primary);
}

.status-pending {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.restaurant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.restaurant-item:last-child {
    border-bottom: none;
}

.restaurant-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.restaurant-info {
    flex: 1;
}

.restaurant-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.restaurant-stats {
    font-size: 12px;
    color: var(--text-light);
}

.restaurant-revenue {
    text-align: right;
}

.restaurant-revenue-value {
    font-weight: 600;
    color: var(--primary);
}

.restaurant-revenue-label {
    font-size: 12px;
    color: var(--text-light);
}

.commission {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dash-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dash-controls {
        margin-top: 8px;
    }
}