/* Dashboard Styles - Mobile First */

/* App Body */
.app-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
}

/* Top Navbar - Mobile */
.top-navbar {
    height: 60px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand-wrapper {
    display: flex;
    align-items: center;
}

.navbar-brand {
    color: #1e293b !important;
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 600;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Sidebar */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

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

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-close {
    float: right;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: #475569;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link:hover {
    background: #f8fafc;
    color: #2563eb;
    border-left-color: #2563eb;
}

.sidebar-nav .nav-link.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 500;
}

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

.nav-section {
    font-size: 0.7rem !important;
    letter-spacing: 0.05em;
    margin-top: 0.5rem !important;
    margin-bottom: 0.25rem !important;
}

.sidebar-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1rem;
    margin-top: auto;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Desktop Sidebar */
@media (min-width: 992px) {
    .main-content {
        margin-left: 260px;
    }
    
    .sidebar {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

.page-content {
    flex: 1;
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    height: 100%;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Cards */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.card-body {
    padding: 1.25rem;
}

/* Quick Actions */
.btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.75rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    background: #f8fafc;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #e2e8f0;
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Badge */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Avatar */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Page Header */
.page-header h1 {
    font-weight: 700;
    color: #1e293b;
}

/* Mobile Adjustments */
@media (max-width: 991.98px) {
    .top-navbar.d-lg-none {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }
    
    .main-content {
        padding-top: 60px;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Table Card View on Mobile */
@media (max-width: 767.98px) {
    .table-responsive table thead {
        display: none;
    }
    
    .table-responsive table,
    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }
    
    .table-responsive tr {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        margin-bottom: 0.75rem;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    }
    
    .table-responsive td {
        padding: 0.5rem 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .table-responsive td:last-child {
        border-bottom: none;
        padding-top: 0.75rem;
    }
    
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .table-responsive td.text-end {
        justify-content: flex-end;
    }
}
