/**
 * Parcel Pilot & Vault Backend Theme Enhancements
 * Clean, modern styling for admin sidebar, navigation, stat cards, and dashboard
 */

:root {
    --dash-border-light: #e2e8f0;
    --dash-border-dark: #334155;
    --dash-card-bg-light: #ffffff;
    --dash-card-bg-dark: #1e293b;
}

/* ========================================================
   1. SIDEBAR REFINEMENTS
   ======================================================== */
.sidebar {
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
}

.sidebar .user {
    padding: 16px 18px 14px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex;
    align-items: center;
}

body[data-background-color="light"] .sidebar .user {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.sidebar .user .avatar-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--admin-primary, #dc2626), var(--admin-secondary, #b91c1c));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.sidebar .user .info {
    margin-left: 12px;
}

.sidebar .user .info a {
    text-decoration: none !important;
}

.sidebar .user .info .user-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    display: block;
}

body[data-background-color="light"] .sidebar .user .info .user-name {
    color: #1e293b !important;
}

.sidebar .user .info .user-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    display: inline-block;
    margin-top: 4px;
}

body[data-background-color="light"] .sidebar .user .info .user-badge {
    background: rgba(0, 0, 0, 0.06);
    color: #64748b;
}

/* Sidebar Section Headers */
.sidebar .nav-section-header {
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: #94a3b8 !important;
    padding: 18px 22px 6px !important;
    margin: 0 !important;
    list-style: none !important;
}

body[data-background-color="light"] .sidebar .nav-section-header {
    color: #64748b !important;
}

/* Sidebar Nav Items */
.sidebar.sidebar-style-2 .nav .nav-item {
    padding: 2px 14px !important;
}

.sidebar.sidebar-style-2 .nav .nav-item a {
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
}

.sidebar.sidebar-style-2 .nav .nav-item a i {
    width: 22px !important;
    font-size: 15px !important;
    margin-right: 12px !important;
    text-align: center !important;
}

.sidebar.sidebar-style-2 .nav .nav-item.active > a {
    background-color: var(--admin-primary, #dc2626) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.sidebar.sidebar-style-2 .nav .nav-item.active > a i,
.sidebar.sidebar-style-2 .nav .nav-item.active > a p {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.sidebar.sidebar-style-2 .nav .nav-item:not(.active) > a:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

body[data-background-color="light"] .sidebar.sidebar-style-2 .nav .nav-item:not(.active) > a:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

/* Submenu / Collapse styling */
.sidebar .nav-collapse {
    margin-top: 4px !important;
    padding-left: 28px !important;
}

.sidebar .nav-collapse li a {
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
}

.sidebar .nav-collapse li.active a {
    font-weight: 700 !important;
    color: var(--admin-primary, #dc2626) !important;
}

body[data-background-color="dark"] .sidebar .nav-collapse li.active a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ========================================================
   2. DASHBOARD CARDS & METRICS
   ======================================================== */
.card {
    border-radius: 14px !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

body[data-background-color="dark"] .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3) !important;
}

.card:hover {
    box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.08) !important;
}

.card.card-stats {
    overflow: hidden;
}

.card.card-stats .icon-big {
    width: 54px !important;
    height: 54px !important;
    line-height: 54px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
}

.card.card-stats .numbers .card-category {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
}

body[data-background-color="dark"] .card.card-stats .numbers .card-category {
    color: #94a3b8 !important;
}

.card.card-stats .numbers .card-title {
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
    margin-bottom: 0 !important;
}

/* Quick Action Buttons */
.btn-quick-action {
    border-radius: 12px !important;
    padding: 10px 18px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.2s ease !important;
}

.btn-quick-action:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14) !important;
}

/* Dashboard Telemetry Bar */
.dashboard-telemetry-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

body[data-background-color="dark"] .dashboard-telemetry-bar {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Operational Hub Badge */
.telemetry-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: telemetryPulse 2s infinite;
}

@keyframes telemetryPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Quick shortcut grid */
.shortcut-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    height: 100%;
}

body[data-background-color="dark"] .shortcut-card {
    background: #1e293b;
    border-color: #334155;
}

.shortcut-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--admin-primary, #dc2626);
}

.shortcut-card .shortcut-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.shortcut-card .shortcut-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

body[data-background-color="dark"] .shortcut-card .shortcut-title {
    color: #f1f5f9;
}

.shortcut-card .shortcut-desc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 0;
    line-height: 1.4;
}

body[data-background-color="dark"] .shortcut-card .shortcut-desc {
    color: #94a3b8;
}

/* Table refinements */
.table thead th {
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-top: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    color: #64748b !important;
}

body[data-background-color="dark"] .table thead th {
    border-bottom-color: #334155 !important;
    color: #94a3b8 !important;
}

.table tbody td {
    vertical-align: middle !important;
    font-size: 13px !important;
    border-color: #f1f5f9 !important;
}

body[data-background-color="dark"] .table tbody td {
    border-color: #334155 !important;
}
