/* === ADMIN LAYOUT === */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #fff;
    border-right: 1px solid var(--color-border);
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-sidebar .admin-logo {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--color-border-light);
}

.admin-sidebar .admin-logo img {
    height: 28px;
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 12px;
    flex: 1;
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: 10px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.admin-sidebar nav a svg {
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.admin-sidebar nav a:hover {
    background: var(--color-muted);
    color: var(--color-text);
}

.admin-sidebar nav a:hover svg {
    opacity: 0.8;
}

.admin-sidebar nav a.active {
    background: var(--color-accent-light);
    color: var(--color-accent-hover);
    font-weight: 600;
}

.admin-sidebar nav a.active svg {
    opacity: 1;
    stroke: var(--color-accent-hover);
}

.admin-sidebar nav a.nav-logout {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
    border-radius: 0 0 10px 10px;
    color: var(--color-error);
}

.admin-sidebar nav a.nav-logout:hover {
    background: #fef2f2;
}

.admin-sidebar nav a.nav-logout svg {
    opacity: 0.7;
    stroke: var(--color-error);
}

.admin-main {
    padding: 40px 48px;
    background: #f9fafb;
    min-width: 0;
}

/* === ADMIN HEADER === */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

/* === STAT CARDS === */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.admin-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.admin-stat-card:hover {
    box-shadow: var(--shadow-md);
}

.admin-stat-card .stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.admin-stat-card .stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.admin-stat-card.stat-accent .stat-number { color: var(--color-accent); }
.admin-stat-card.stat-success .stat-number { color: var(--color-success); }
.admin-stat-card.stat-error .stat-number { color: var(--color-error); }

/* === TABELAS === */
.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

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

.data-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-light);
    background: transparent;
}

.data-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--color-muted);
}

.data-table a {
    color: var(--color-accent-hover);
    font-weight: 500;
}

.data-table a:hover {
    text-decoration: underline;
}

/* === STATUS BADGES === */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.status-nova {
    background: var(--color-accent-light);
    color: var(--color-accent-hover);
}

.status-em_atendimento {
    background: #eff6ff;
    color: #2563eb;
}

.status-fechada {
    background: #ecfdf5;
    color: #059669;
}

.status-perdida {
    background: #fef2f2;
    color: var(--color-error);
}

/* === ALERTS === */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-left-color: var(--color-success);
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-left-color: var(--color-error);
    color: #991b1b;
}

/* === SECTION HEADERS === */
.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.admin-section-header a {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent-hover);
    text-decoration: none;
}

.admin-section-header a:hover {
    text-decoration: underline;
}

/* === ÁREA DO CLIENTE === */
.cliente-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
}

.cliente-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.cliente-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cliente-sidebar nav a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: 10px;
    transition: all 0.15s ease;
}

.cliente-sidebar nav a:hover {
    background: var(--color-muted);
    color: var(--color-text);
}

.cliente-sidebar nav a.active {
    background: var(--color-accent-light);
    color: var(--color-accent-hover);
    font-weight: 600;
}

.cliente-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.cliente-stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.cliente-stat-card .number {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 4px;
    line-height: 1;
}

.cliente-stat-card .label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* === RESPONSIVO === */
@media (max-width: 1024px) {
    .admin-main {
        padding: 32px 24px;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .admin-sidebar .admin-logo {
        display: none;
    }

    .admin-sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .admin-sidebar nav a {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
    }

    .admin-sidebar nav a.nav-logout {
        margin-top: 0;
        border-top: none;
        padding-top: 8px;
    }

    .admin-main {
        padding: 24px 16px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cliente-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cliente-sidebar {
        position: static;
    }

    .cliente-sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
    }
}
