/*
 * CAMPUS CARE DAILY WORK MANAGER
 * Modern SaaS & Notion-inspired Theme
 * Navy Blue (#0F172A), Slate (#1E293B), Primary Accent (#2563EB), Subtle Green (#10B981)
 * Developed by SOFTKEYBAZAR (https://www.softkeybazar.com)
 */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, 'SolaimanLipi', 'Kalpurush';
    --bg-app: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #FFFFFF;
    --border-color: #E2E8F0;
    --border-subtle: #F1F5F9;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    --brand-navy: #0F172A;
    --brand-navy-light: #1E293B;
    --brand-blue: #2563EB;
    --brand-blue-hover: #1D4ED8;
    --brand-green: #10B981;
    --brand-green-light: #ECFDF5;
    --brand-warning: #F59E0B;
    --brand-danger: #EF4444;
    
    --sidebar-width: 270px;
    --topbar-height: 68px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-app: #0B1120;
    --bg-surface: #131D31;
    --bg-surface-elevated: #1E293B;
    --border-color: #27354F;
    --border-subtle: #1C273E;
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Global Reset & Base */
body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--brand-blue-hover);
}

/* Layout Architecture */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--brand-navy);
    color: #F8FAFC;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #2563EB, #10B981);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.sidebar-brand-text {
    line-height: 1.2;
}
.sidebar-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
}
.sidebar-brand-sub {
    font-size: 0.72rem;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.sidebar-nav-wrap {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

/* Custom scrollbar for sidebar */
.sidebar-nav-wrap::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav-wrap::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-menu-header {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748B;
    font-weight: 700;
    padding: 0.85rem 0.75rem 0.4rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    color: #CBD5E1;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}
.sidebar-nav-item i {
    font-size: 1.15rem;
    opacity: 0.85;
    transition: var(--transition);
}
.sidebar-nav-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-nav-item:hover i {
    opacity: 1;
    transform: translateX(2px);
}
.sidebar-nav-item.active {
    background: linear-gradient(90deg, #2563EB, #1D4ED8);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.sidebar-nav-item.active i {
    opacity: 1;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar */
.app-topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-clock-widget {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-app);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.topbar-date-display {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}
.topbar-clock-display {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-blue);
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.topbar-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.lang-switch-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.lang-switch-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

/* Page Body Container */
.app-content {
    flex-grow: 1;
    padding: 1.75rem;
}

/* Page Header */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}
.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 3px 0 0;
}

/* Cards & Surfaces */
.modern-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}
.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.card-header-clean {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}
.card-header-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-body-clean {
    padding: 1.5rem;
}

/* Dashboard Stat Cards */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--stat-accent, var(--brand-blue));
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--stat-bg, rgba(37, 99, 235, 0.1));
    color: var(--stat-accent, var(--brand-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.9rem;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.stat-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Stat card variants */
.stat-today { --stat-accent: #2563EB; --stat-bg: rgba(37, 99, 235, 0.1); }
.stat-completed { --stat-accent: #10B981; --stat-bg: rgba(16, 185, 129, 0.1); }
.stat-pending { --stat-accent: #F59E0B; --stat-bg: rgba(245, 158, 11, 0.1); }
.stat-problems { --stat-accent: #EF4444; --stat-bg: rgba(239, 68, 68, 0.1); }
.stat-repair { --stat-accent: #8B5CF6; --stat-bg: rgba(139, 92, 246, 0.1); }
.stat-maintenance { --stat-accent: #06B6D4; --stat-bg: rgba(6, 182, 212, 0.1); }
.stat-urgent { --stat-accent: #EC4899; --stat-bg: rgba(236, 72, 153, 0.1); }
.stat-monthly { --stat-accent: #1E293B; --stat-bg: rgba(30, 41, 59, 0.1); }

/* Tables */
.table-responsive {
    border-radius: var(--radius-md);
}
.table-custom {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.table-custom th {
    background: var(--bg-app);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}
.table-custom td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    background: var(--bg-surface);
}
.table-custom tbody tr:hover td {
    background-color: var(--border-subtle);
}

/* Badges */
.badge-pulse {
    animation: pulseGlow 1.8s infinite;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Forms */
.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}
.form-control, .form-select {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    background-color: var(--bg-surface);
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    color: var(--text-primary);
}
.form-control::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    background-color: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    transition: var(--transition);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-blue-hover);
    border-color: var(--brand-blue-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-success {
    background-color: var(--brand-green);
    border-color: var(--brand-green);
    font-weight: 600;
    border-radius: var(--radius-sm);
}
.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.btn-outline-secondary:hover {
    background-color: var(--border-subtle);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Filter Bar */
.filter-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Footer Credit */
.app-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 1.75rem;
    margin-top: auto;
}
.footer-credit-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-links a {
    color: var(--text-secondary);
    margin-left: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.footer-links a:hover {
    color: var(--brand-blue);
}

/* Mobile Sidebar Drawer */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .topbar-clock-widget {
        display: none;
    }
}
