/* ============================================================
   e-Government System - Main Stylesheet
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --gov-primary: #1a3e6e;
    --gov-secondary: #2563eb;
    --gov-accent: #f59e0b;
    --gov-success: #10b981;
    --gov-danger: #ef4444;
    --gov-warning: #f59e0b;
    --sidebar-bg: #1a3e6e;
    --sidebar-text: #cbd5e1;
    --sidebar-hover: rgba(255,255,255,0.1);
    --sidebar-active: #2563eb;
    --topbar-bg: #ffffff;
    --body-bg: #f1f5f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
    background: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #334155;
}

/* ---- Layout ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.page-content {
    padding: 1.5rem;
    flex: 1;
    margin-top: var(--topbar-height);
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.2rem 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.3px;
}
.sidebar-brand i { font-size: 1.4rem; color: var(--gov-accent); }

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

.avatar-circle {
    width: 38px; height: 38px;
    background: var(--gov-secondary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user .fw-semibold { color: #fff; font-size: 0.875rem; max-width: 160px; }
.sidebar-user small { color: var(--sidebar-text); font-size: 0.75rem; }

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-section {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem 0.3rem;
    margin-top: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.55rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    font-size: 0.875rem;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: var(--gov-secondary);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav a i { font-size: 1rem; width: 18px; flex-shrink: 0; }
.sidebar-nav a .badge { font-size: 0.65rem; }

/* ---- Topbar ---- */
.topbar {
    position: fixed;
    top: 0; right: 0;
    left: var(--sidebar-width);
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 999;
    gap: 1rem;
    transition: left 0.3s;
}

.topbar-title { font-weight: 600; color: var(--gov-primary); }
.sidebar-toggle { background: none; border: none; color: var(--gov-primary); }

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }

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

.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.yellow { background: #fef9c3; color: #ca8a04; }
.stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--gov-primary); line-height: 1; }
.stat-label { color: #64748b; font-size: 0.8rem; margin-top: 3px; }

/* ---- Tables ---- */
.table { font-size: 0.875rem; }
.table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    padding: 0.75rem 1rem;
}
.table td { padding: 0.75rem 1rem; vertical-align: middle; border-color: #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }

/* ---- Forms ---- */
.form-label { font-weight: 500; color: #374151; font-size: 0.875rem; }
.form-control, .form-select {
    border-color: #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gov-secondary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ---- Buttons ---- */
.btn { border-radius: 6px; font-size: 0.875rem; font-weight: 500; }
.btn-primary { background: var(--gov-secondary); border-color: var(--gov-secondary); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-gov { background: var(--gov-primary); border-color: var(--gov-primary); color: #fff; }
.btn-gov:hover { background: #142f52; border-color: #142f52; color: #fff; }

/* ---- Badges ---- */
.badge { font-size: 0.7rem; padding: 0.35em 0.6em; border-radius: 4px; font-weight: 600; }

/* ---- Page Title ---- */
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--gov-primary); margin-bottom: 0; }
.page-subtitle { color: #64748b; font-size: 0.85rem; margin-top: 2px; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content:''; position:absolute; left:0.75rem; top:0; bottom:0; width:2px; background:#e2e8f0; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before { content:''; position:absolute; left:-1.625rem; top:0.3rem; width:10px; height:10px; border-radius:50%; background:var(--gov-secondary); border:2px solid #fff; box-shadow:0 0 0 2px var(--gov-secondary); }
.timeline-date { font-size:0.75rem; color:#94a3b8; margin-bottom:0.25rem; }
.timeline-content { background:#f8fafc; border-radius:8px; padding:0.75rem 1rem; border-left:3px solid var(--gov-secondary); }

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gov-primary) 0%, #1e40af 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo i { font-size: 3rem; color: var(--gov-primary); }
.login-logo h2 { color: var(--gov-primary); font-weight: 800; margin: 0.5rem 0 0.25rem; }
.login-logo p { color: #64748b; font-size: 0.875rem; margin: 0; }

/* ---- Homepage ---- */
.hero-section {
    background: linear-gradient(135deg, var(--gov-primary) 0%, #1e40af 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); color: inherit; }
.service-icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* ---- Status Track ---- */
.track-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.track-step:last-child { border-bottom: none; }
.track-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.track-dot.done { background: #dcfce7; color: #16a34a; }
.track-dot.current { background: #dbeafe; color: #2563eb; }
.track-dot.waiting { background: #f1f5f9; color: #94a3b8; }

/* ---- Queue Ticket ---- */
.ticket-card {
    background: linear-gradient(135deg, var(--gov-primary), #2563eb);
    color: #fff;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 320px;
    margin: auto;
    box-shadow: 0 8px 30px rgba(26,62,110,0.3);
}
.ticket-number { font-size: 3rem; font-weight: 900; letter-spacing: 2px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar { left: 0; }
    .page-content { padding: 1rem; }
}

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { margin-top: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ---- Utilities ---- */
.text-gov { color: var(--gov-primary) !important; }
.bg-gov { background: var(--gov-primary) !important; }
.border-gov { border-color: var(--gov-primary) !important; }
.fw-600 { font-weight: 600; }
.fs-13 { font-size: 13px; }
.rounded-10 { border-radius: 10px; }

/* ═══════════════════════════════════════════════════════════════
   DMS — Document Management System Styles
   ═══════════════════════════════════════════════════════════════ */

/* File type icon badges */
.dms-file-icon {
    width:38px; height:38px; border-radius:8px; display:inline-flex;
    align-items:center; justify-content:center; font-size:.65rem;
    font-weight:800; letter-spacing:.02em; flex-shrink:0;
}
.dms-icon-pdf   { background:#fee2e2; color:#dc2626; }
.dms-icon-word  { background:#dbeafe; color:#2563eb; }
.dms-icon-excel { background:#dcfce7; color:#16a34a; }
.dms-icon-ppt   { background:#ffedd5; color:#ea580c; }
.dms-icon-img   { background:#f3e8ff; color:#9333ea; }
.dms-icon-zip   { background:#fef9c3; color:#ca8a04; }
.dms-icon-txt   { background:#f1f5f9; color:#64748b; }
.dms-icon-file  { background:#f1f5f9; color:#94a3b8; }

/* Drop zone */
#dropZone:hover { border-color:#2563eb !important; background:#eff6ff !important; }

/* DMS cards */
.dms-stat-mini {
    background:#fff; border-radius:8px; padding:.75rem 1rem;
    display:flex; align-items:center; gap:.75rem;
    box-shadow:0 1px 3px rgba(0,0,0,.06);
}
