/* Option 6.0 - Uber-like Design System (Base Web Inspired) */
:root {
    /* Core Colors */
    --primary: #000000;
    --primary-dark: #333333;
    --primary-light: #F6F6F6;
    /* Used for hover states/backgrounds */
    --primary-text-contrast: #FFFFFF;

    /* Semantic Colors */
    --accent-green: #05944F;
    /* Positive/Success */
    --accent-green-bg: #E3F5E8;
    --accent-red: #E11900;
    /* Negative/Error */
    --accent-red-bg: #FCE8E6;
    --accent-yellow: #FFC043;
    /* Warning */
    --accent-yellow-bg: #FFF8E1;
    --accent-blue: #276EF1;
    /* Info/Link */
    --accent-blue-bg: #E8F0FE;

    /* Neutrals */
    --bg-body: #F6F6F6;
    --bg-card: #FFFFFF;
    --bg-hover: #F3F3F3;
    --text-primary: #000000;
    --text-secondary: #545454;
    --text-muted: #757575;
    --border: #E2E2E2;
    --border-light: #EEEEEE;

    /* Gradients (Removed for cleaner flat look, kept var for compatibility) */
    --gradient-primary: #000000;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Spacing & Layout */
    --sidebar-width: 260px;
    --header-height: 72px;
    --border-radius: 24px;
    /* Increased radius for modern look */
    --border-radius-sm: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --admin-animations: 1;
    --admin-anim-fast: 0.12s;
    --admin-anim-base: 0.22s;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    font-size: 14px;
    line-height: 20px;
    -webkit-font-smoothing: antialiased;
    /* FOUC Prevention removed to avoid blank screens on error */
    /* visibility: hidden; */
    /* opacity: 0; */
    /* transition: opacity 0.3s ease; */
}

body.loaded {
    /* visibility: visible; */
    /* opacity: 1; */
    animation: fadeIn var(--admin-anim-fast) ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============ SIDEBAR ============ */
admin-sidebar {
    display: contents;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 12px;
    /* Less rounded */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.logo-badge {
    font-size: 10px;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: auto;
    text-transform: uppercase;
}

/* Navigation */
.nav-section {
    padding: 24px 16px 8px;
}

.nav-title {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 0 12px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    /* Increased padding */
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    margin: 0 8px;
    /* Add margin for floating effect */
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--bg-body);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    /* Subtle shadow instead of border */
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 20px;
    text-align: center;
}

.nav-badge.warning {
    background: var(--accent-yellow);
    color: #4A3C00;
    /* Darker text for contrast on yellow */
}

/* User Profile in Sidebar */
.sidebar-user {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}

.user-info:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 12px;
    border: 1px solid var(--border);
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--primary-light);
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 8px 12px;
    gap: 12px;
    width: 360px;
    transition: all 0.2s;
}

.search-box:focus-within {
    background: var(--bg-card);
    border-color: var(--primary);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    outline: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 1px solid var(--bg-card);
}

/* Dashboard Content */
.dashboard {
    padding: 32px;
    flex: 1;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius);
    padding: 32px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    border-color: var(--border);
    background: var(--bg-hover);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Rounded for icons */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Icon backgrounds - keep subtle */
.stat-icon.primary {
    background: var(--bg-body);
    color: var(--text-primary);
}

.stat-icon.success {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.stat-icon.warning {
    background: var(--accent-yellow-bg);
    color: #925300;
}

.stat-icon.danger {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.stat-trend.up {
    color: var(--accent-green);
}

.stat-trend.down {
    color: var(--accent-red);
}

.stat-value {
    font-size: 36px;
    /* Larger */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Main Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
}

.card-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 50px;
    /* Pill shaped buttons */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-text-contrast);
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); REMOVED SHADOW */
    /* Subtle shadow for action */
}

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

.btn-secondary {
    background: var(--primary-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #E2E2E2;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-hover);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--bg-hover);
}

.btn-icon.text-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Table */
.table-container {
    padding: 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    /* Required for border spacing */
    border-spacing: 0;
}

th,
td {
    padding: 18px 32px;
    /* More spacing */
    text-align: left;
}

th {
    background: white;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}

td {
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
}

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

tr:hover td {
    background: var(--bg-hover);
}

/* Specific Cells */
.user-cell,
.driver-cell {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-cell-avatar,
.driver-avatar {
    width: 40px;
    /* Larger avatars */
    height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--border);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.pending {
    background: var(--accent-yellow-bg);
    color: #925300;
}

.status-badge.approved,
.status-badge.complete,
.status-badge.online {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.status-badge.rejected,
.status-badge.cancelled,
.status-badge.offline {
    background: var(--accent-red-bg);
    color: var(--accent-red);
}

/* Badges specifically for dots */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-dot.online {
    background-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(5, 148, 79, 0.2);
}

.status-dot.offline {
    background-color: var(--text-muted);
}

.status-dot.busy {
    background-color: var(--accent-red);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 32px;
}

.quick-action-btn {
    padding: 24px;
    border-radius: var(--border-radius);
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover {
    background: var(--bg-hover);
}

.quick-action-btn.whatsapp:hover {
    background: #e7f7ed;
    color: #25D366;
}

.quick-action-btn i {
    font-size: 28px;
    margin-bottom: 16px;
    display: block;
}

.quick-action-btn span {
    font-size: 15px;
    font-weight: 500;
}

/* Activity Feed */
.activity-item {
    display: flex;
    gap: 20px;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--bg-body);
}

.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-icon.ride {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.activity-icon.payment {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.activity-icon.driver {
    background: var(--accent-blue-bg);
    color: var(--accent-blue);
}

.activity-icon.passenger {
    background: var(--accent-green-bg);
    color: var(--accent-green);
}

.activity-icon.document {
    background: var(--accent-yellow-bg);
    color: #925300;
}

/* Map */
#admin-map {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow-md);
    height: 100%;
    min-height: 500px;
}

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

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

/* ============ MODERN RIDE MODAL ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.modal-modern {
    background: var(--bg-card);
    width: 90%;
    max-width: 650px;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-modern {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--primary-light);
}

.ride-id-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.ride-date-sub {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-body-scroll {
    overflow-y: auto;
    padding: 32px;
}

/* Route Timeline */
.route-section {
    margin-bottom: 32px;
    display: flex;
    gap: 16px;
}

.timeline-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 6px;
}

.dot-origin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
}

.line-connector {
    width: 2px;
    flex: 1;
    background: var(--border);
    margin: 4px 0;
    min-height: 40px;
}

.dot-dest {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
}

.route-text {
    flex: 1;
}

.route-point {
    margin-bottom: 24px;
}

.route-point:last-child {
    margin-bottom: 0;
}

.point-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.point-address {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
}

/* Stats Row */
.ride-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
    background: var(--primary-light);
    padding: 16px;
    border-radius: 12px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mini-stat i {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.mini-stat-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Participants */
.participants-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.participant-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    text-align: center;
}

.p-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 12px;
    object-fit: cover;
    background: var(--bg-hover);
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.p-role {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.p-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.p-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.star-icon {
    color: var(--accent-yellow);
    font-size: 12px;
}

.p-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.action-icon-btn {
    flex: 1;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.action-icon-btn.whatsapp:hover {
    background: #e7f7ed;
    color: #25D366;
    border-color: #25D366;
}

/* Financial */
.financial-summary {
    background: var(--bg-body);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fin-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.final-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: -0.5px;
}

.cancel-reason-box {
    margin-top: 20px;
    padding: 16px;
    background: var(--accent-red-bg);
    border-left: 3px solid var(--accent-red);
    border-radius: 4px;
}

.cr-title {
    color: var(--accent-red);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cr-text {
    color: #900;
    font-size: 14px;
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    /* ============ TOAST / SNACKBAR ============ */
    .toast-container {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .toast {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 24px;
        background: #333333;
        /* Dark background */
        color: #FFFFFF;
        /* High contrast white text */
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        min-width: 300px;
        max-width: 450px;
        font-size: 14px;
        font-weight: 500;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 4px solid #333;
    }

    .toast.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .toast-success {
        border-left-color: var(--accent-green);
    }

    .toast-error {
        border-left-color: var(--accent-red);
    }

    .toast-warning {
        border-left-color: var(--accent-yellow);
        color: #FFF;
        /* Keep text white even for warning */
    }

    .toast-info {
        border-left-color: var(--accent-blue);
    }

    .toast-icon {
        font-size: 18px;
    }

    .toast-success .toast-icon {
        color: var(--accent-green);
    }

    .toast-error .toast-icon {
        color: var(--accent-red);
    }

    .toast-warning .toast-icon {
        color: var(--accent-yellow);
    }

    .toast-info .toast-icon {
        color: var(--accent-blue);
    }

    .toast-close {
        margin-left: auto;
        background: none;
        border: none;
        color: #999;
        cursor: pointer;
        font-size: 16px;
        padding: 4px;
    }

    .toast-close:hover {
        color: #FFF;
    }

    .sidebar.open {
        transform: translateX(0);
    }
}

/* Additional Components */
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /* Fully round */
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.chart-placeholder {
    height: 320px;
    background: linear-gradient(135deg, var(--bg-hover) 0%, white 100%);
    margin: 0;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    font-weight: 500;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Detail Rows */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

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

.detail-value {
    font-weight: 500;
    text-align: right;
    color: var(--text-primary);
}

/* Login Page Specifics */
body.login-page {
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
}

.login-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-section img {
    height: 60px;
    margin-bottom: 16px;
}

.logo-section h1 {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
}

.logo-section p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.admin-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 12px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary-light);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-message {
    background: var(--accent-red-bg);
    color: var(--accent-red);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 8px;
}

.error-message.show {
    display: flex;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.footer-text {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Pricing Settings Specifics */
.settings-section {
    padding: 32px;
}

.risk-alert {
    background: var(--bg-body);
    border-left: 4px solid var(--text-primary);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.risk-alert i {
    font-size: 16px;
    color: var(--text-primary);
    margin-top: 3px;
}

.category-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 16px;
    overflow-x: auto;
}

.tab-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.range-container {
    background: #FAFAFA;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.range-container:hover {
    border-color: var(--border);
}

.range-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.range-header i {
    margin-right: 10px;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 20px;
}

.range-input-group {
    flex: 1;
}

.input-label-sm {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.range-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    padding-top: 16px;
    /* Align with input */
}

.risk-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px dashed var(--border);
}

.form-helper {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

/* Fix Input override for ranges */
.range-input-group .form-input {
    background: white;
    height: 44px;
    border-color: var(--border);
}

.range-input-group .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    /* Focus ring */
}

/* Action Menu Dropdown */
.action-menu {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
    animation: fadeIn 0.1s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-menu-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.1s;
}

.action-menu-item:hover {
    background: var(--bg-hover);
}

.action-menu-item i {
    width: 16px;
    color: var(--text-secondary);
}

.action-menu-item.danger {
    color: var(--accent-red);
}

.action-menu-item.danger i {
    color: var(--accent-red);
}

/* Star Ratings */
.star-filled {
    color: var(--accent-yellow);
}

.star-empty {
    color: var(--border);
}

/* ============ GOOGLE MATERIAL RIPPLE (CSS-ONLY) ============ */

/* 1. Base Container Setup */
.btn,
.nav-link,
.header-btn,
.quick-action-btn,
.stat-card,
.activity-item,
.user-info,
.action-menu-item {
    position: relative;
    overflow: hidden;
    /* Contains the ripple */
    transform: translate3d(0, 0, 0);
    /* GPU Acceleration */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Material Ease */
    cursor: pointer;
}

/* 2. The Ripple Pseudo-Element */
.btn::after,
.nav-link::after,
.header-btn::after,
.quick-action-btn::after,
.stat-card::after,
.activity-item::after,
.user-info::after,
.action-menu-item::after,
.btn-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    /* Ensure it covers the whole element */
    padding-bottom: 200%;
    /* Make it square */
    border-radius: 50%;

    /* Default Ripple Color (Dark for Light Backgrounds) */
    background: rgba(0, 0, 0, 0.1);

    /* End State: Expanded and Invisible */
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;

    /* Animation definition */
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    pointer-events: none;
}

/* 3. Specific Ripple Colors */
/* Primary Buttons need White Ripple */
.btn-primary::after {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Links need specific ripple to look good on white/gray */
.nav-link::after {
    background: rgba(0, 0, 0, 0.05);
}

/* 4. The Trigger (Active State) */
/* When pressed, it resets instantly to small and visible central dot */
.btn:active::after,
.nav-link:active::after,
.header-btn:active::after,
.quick-action-btn:active::after,
.stat-card:active::after,
.activity-item:active::after,
.user-info:active::after,
.action-menu-item:active::after,
.btn-icon:active::after {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.3;
    transition: 0s;
    /* Instant reset */
}

/* 5. Material Elevation (Hover & Active States) */
/* 5. Legacy Elevation Removed */

/* ============ DROPDOWN ANIMATION (Google Style) ============ */
@keyframes dropdownMaterial {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.admin-filter-dropdown {
    /* Google Material 3 Standard Decelerate */
    animation: dropdownMaterial 0.2s cubic-bezier(0.2, 0.0, 0, 1.0) forwards;
    transform-origin: top left;
    /* Origins from the button usually */
    /* Ensure shadows are consistent */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid var(--border-light) !important;
}

/* Ensure dropdown items also have hover effect */
.admin-filter-dropdown div:hover {
    background-color: var(--bg-hover) !important;
}

/* Specific fix for header buttons to remain circular/balanced */
.header-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: none;
}

.header-btn:active {
    /* Handled by Unified System */
}

/* ============ UNIFIED INTERACTIVE SYSTEM ============ */
/* Applies consistent Flat Design + Ripple Scale interactions to all clickable elements */

:root {
    --hover-dimability: brightness(0.96);
    --active-scale: scale(0.97);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.header-btn,
.nav-link,
.quick-action-btn,
.stat-card,
.user-info,
.activity-item,
.action-btn,
.icon-btn,
.tab-btn,
.modal-close,
.modal-close-btn,
.action-icon-btn,
.notification-dot {
    transition: transform 0.1s ease, filter 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* UNIVERSAL HOVER: Darken slightly, NO elevation */
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover,
.header-btn:hover,
.nav-link:hover,
.quick-action-btn:hover,
.stat-card:hover,
.user-info:hover,
.activity-item:hover,
.action-btn:hover,
.icon-btn:hover,
.tab-btn:hover,
.btn-icon:hover,
.modal-close:hover,
.modal-close-btn:hover,
.action-icon-btn:hover {
    transform: none !important;
    box-shadow: none !important;
    /* Force removal of shadows on hover */
    filter: var(--hover-dimability);
    z-index: 1;
}

/* UNIVERSAL ACTIVE: Scale down (Ripple feel) */
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-outline:active,
.header-btn:active,
.nav-link:active,
.quick-action-btn:active,
.stat-card:active,
.user-info:active,
.btn-icon:active,
.activity-item:active,
.action-btn:active,
.icon-btn:active,
.tab-btn:active,
.modal-close:active,
.modal-close-btn:active,
.action-icon-btn:active {
    transform: var(--active-scale) !important;
    filter: brightness(0.9);
}

/* ============ DROPDOWN ANIMATION (Emphasized/Power) ============ */
@keyframes dropdownPower {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.admin-filter-dropdown {
    /* "Power" Easing: Starts extremely fast, hits the wall hard. Very perceptible. */
    animation: dropdownPower 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top left;
    /* Ensure shadows are consistent */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid var(--border-light) !important;
}

/* ============ SHARED ANIMATIONS ============ */
@keyframes admin-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes admin-slide-out-right {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes admin-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes admin-fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes admin-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes admin-scale-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes admin-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.admin-anim-slide-in-right {
    animation: admin-slide-in-right var(--admin-anim-base) ease;
}

.admin-anim-slide-out-right {
    animation: admin-slide-out-right var(--admin-anim-base) ease forwards;
}

.admin-anim-fade-in {
    animation: admin-fade-in var(--admin-anim-fast) ease forwards;
}

.admin-anim-fade-out {
    animation: admin-fade-out var(--admin-anim-fast) ease forwards;
}

.admin-anim-scale-in {
    animation: admin-scale-in var(--admin-anim-fast) ease;
}

.admin-anim-scale-out {
    animation: admin-scale-out var(--admin-anim-fast) ease forwards;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary, #252540) 25%, var(--bg-tertiary, #2a2a4a) 50%, var(--bg-secondary, #252540) 75%);
    background-size: 200% 100%;
    animation: admin-shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-row td {
    padding: 12px 15px !important;
}
