/* ===== SiARSIP Design System ===== */
:root {
  --navy: #0f2642;
  --navy-mid: #1a3a5c;
  --navy-light: #234d78;
  --gold: #e8a020;
  --gold-light: #f5c55a;
  --gold-pale: #fef6e4;
  --green: #1a7a4a;
  --green-light: #d4f0e2;
  --red: #c0392b;
  --red-light: #fde8e6;
  --blue-soft: #e8f2fb;
  --white: #ffffff;
  --gray-50: #f8f9fb;
  --gray-100: #eef0f4;
  --gray-200: #d8dce6;
  --gray-400: #8e97aa;
  --gray-600: #505a6e;
  --gray-800: #1e2535;
  --shadow-sm: 0 1px 3px rgba(15,38,66,0.08), 0 1px 2px rgba(15,38,66,0.04);
  --shadow-md: 0 4px 16px rgba(15,38,66,0.10), 0 2px 6px rgba(15,38,66,0.06);
  --shadow-lg: 0 12px 40px rgba(15,38,66,0.14), 0 4px 12px rgba(15,38,66,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Calibri', 'Carlito', sans-serif; font-weight: 700; background: var(--gray-50); color: var(--gray-800); min-height: 100vh; overflow-x: hidden; }

/* ===== LOGIN ===== */
#login-page { min-height: 100vh; display: flex; align-items: stretch; background: var(--navy); }
.login-left { flex: 1; background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%); display: flex; flex-direction: column; justify-content: center; padding: 60px; position: relative; overflow: hidden; }
.login-left::before { content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(232,160,32,0.12) 0%, transparent 70%); top: -100px; right: -100px; }
.login-left::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(232,160,32,0.08) 0%, transparent 70%); bottom: 60px; left: 20px; }
.login-logo-area { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; margin-bottom: 52px; }
.login-logo-seal { width: 64px; height: 64px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 4px 20px rgba(232,160,32,0.4); }
.login-logo-text h1 { font-family: 'Calibri', 'Carlito', serif; font-size: 22px; font-weight: 400; color: var(--white); letter-spacing: 0.3px; }
.login-logo-text p { font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 2px; letter-spacing: 0.5px; text-transform: uppercase; }
.login-hero { position: relative; z-index: 1; }
.login-hero h2 { font-family: 'Calibri', 'Carlito', sans-serif; font-size: 48px; font-weight: 700; color: var(--white); line-height: 1.18; margin-bottom: 18px; }
.login-hero h2 span { color: var(--gold); }
.login-hero p { font-size: 15px; color: rgba(255,255,255,0.6); line-height: 1.7; max-width: 360px; }
.login-bidang-list { position: relative; z-index: 1; margin-top: 44px; display: flex; flex-direction: column; gap: 10px; }
.login-bidang-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10); border-radius: var(--radius-sm); padding: 10px 14px; }
.login-bidang-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.login-bidang-item span { font-size: 13px; color: rgba(255,255,255,0.75); }
.login-right { width: 480px; background: var(--white); display: flex; flex-direction: column; justify-content: center; padding: 60px 52px; }
.login-form-header { margin-bottom: 36px; }
.login-form-header h3 { font-size: 26px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.login-form-header p { font-size: 14px; color: var(--gray-400); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 7px; letter-spacing: 0.2px; }
.form-group select, .form-group input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; color: var(--gray-800); background: var(--white); transition: border-color 0.2s, box-shadow 0.2s; outline: none; appearance: none; -webkit-appearance: none; }
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e97aa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.form-group input:focus, .form-group select:focus { border-color: var(--navy-light); box-shadow: 0 0 0 3px rgba(35,77,120,0.10); }
.btn-login { width: 100%; padding: 14px; background: var(--navy); color: var(--white); border: none; border-radius: var(--radius-sm); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: background 0.2s, transform 0.1s, box-shadow 0.2s; box-shadow: 0 4px 14px rgba(15,38,66,0.25); }
.btn-login:hover { background: var(--navy-light); box-shadow: 0 6px 20px rgba(15,38,66,0.30); }
.btn-login:active { transform: translateY(1px); }
.login-error { background: var(--red-light); border: 1px solid #f5c6c2; color: var(--red); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.login-hint { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--gray-100); }
.login-hint p { font-size: 12px; color: var(--gray-400); margin-bottom: 10px; }
.hint-accounts { display: flex; flex-direction: column; gap: 5px; }
.hint-row { font-size: 12px; color: var(--gray-600); display: flex; gap: 6px; }
.hint-row span:first-child { color: var(--gray-400); min-width: 200px; }

/* ===== APP SHELL ===== */
.app-header { background: var(--navy); color: var(--white); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 6px 30px rgba(0,0,0,0.3); position: relative; z-index: 100; border-bottom: none; }
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-seal { width: 34px; height: 34px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.header-brand h1 { font-family: 'DM Serif Display', serif; font-size: 17px; font-weight: 400; color: var(--white); margin: 0; line-height: 1; }
.header-right { display: flex; align-items: center; gap: 18px; }
.header-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--navy); }
.user-info p { font-size: 13px; font-weight: 600; color: var(--white); margin: 0; line-height: 1.2; }
.user-info span { font-size: 11px; color: rgba(255,255,255,0.5); display: block; margin-top: 2px; }
.btn-logout { padding: 7px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75); font-family: inherit; font-size: 12px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-logout:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.app-body { display: flex; flex: 1; overflow: hidden; }
.sidebar { width: 230px; flex-shrink: 0; background: var(--navy); border-right: none; padding: 20px 0; display: flex; flex-direction: column; overflow-y: auto; position: relative; z-index: 90; box-shadow: 6px 0 30px rgba(0,0,0,0.25); }
.sidebar-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,0.6); text-transform: uppercase; padding: 0 20px; margin: 16px 0 6px; }
.sidebar-section-label:first-child { margin-top: 0; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 20px; font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.85); cursor: pointer; border-left: 3px solid transparent; transition: all 0.15s; text-decoration: none; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.nav-item.active { background: rgba(255,255,255,0.15); color: var(--white); border-left-color: var(--white); font-weight: 600; }
.main-content { flex: 1; padding: 28px 32px; overflow-y: auto; position: relative; background: var(--gray-50); box-shadow: inset 0px 6px 15px rgba(0,0,0,0.04), inset 6px 0px 15px rgba(0,0,0,0.02); }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.page-header p { font-size: 14px; color: var(--gray-400); margin-top: 3px; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }

/* Stats */
.stats-grid { margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); position: relative; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s 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: 3px; background: var(--navy); }
.stat-card.gold::before { background: var(--navy); }
.stat-card.navy::before { background: var(--navy); }
.stat-card.green::before { background: var(--navy); }
.stat-card.blue::before { background: var(--navy); }
.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-number { font-size: 28px; font-weight: 700; color: var(--gray-800); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.stat-sub { font-size: 12px; color: var(--green); margin-top: 8px; font-weight: 600; }

/* Section Card */
.section-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); margin-bottom: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.section-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.section-card-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.section-card-header h3 { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.section-card-header p { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.section-card-body { padding: 22px; }

/* Bidang Grid */
.bidang-grid { margin-bottom: 20px; }
.bidang-card { border: 1.5px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: all 0.2s; position: relative; }
.bidang-card:hover { border-color: var(--navy-light); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.bidang-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bidang-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.bidang-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-complete { background: var(--green-light); color: var(--green); }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-missing { background: var(--red-light); color: var(--red); }
.bidang-name { font-size: 14px; font-weight: 700; color: var(--gray-800); margin-bottom: 3px; }
.bidang-sub { font-size: 12px; color: var(--gray-400); }
.bidang-progress { margin-top: 12px; }
.progress-bar { background: var(--gray-100); border-radius: 4px; height: 5px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.fill-green { background: var(--green); }
.fill-gold { background: var(--gold); }
.fill-red { background: var(--red); }
.progress-label { font-size: 11px; color: var(--gray-400); margin-top: 5px; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--gray-50); padding: 11px 14px; font-size: 11px; font-weight: 700; color: var(--gray-400); text-align: left; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--gray-100); }
.data-table td { padding: 13px 14px; font-size: 13.5px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.file-icon { font-size: 18px; margin-right: 8px; vertical-align: middle; }
.file-name { font-weight: 600; color: var(--gray-800); }
.file-meta { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.status-pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; display: inline-block; }

/* Buttons */
.btn { padding: 9px 18px; border-radius: var(--radius-sm); border: none; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-light); box-shadow: var(--shadow-md); }
.btn-outline { background: var(--white); color: var(--navy); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d4911a; }

/* Upload Zone */
.upload-zone { border: 2px dashed var(--gray-200); border-radius: var(--radius); padding: 40px 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-zone:hover { border-color: var(--navy-light); background: var(--blue-soft); }
.upload-zone-icon { font-size: 36px; margin-bottom: 12px; }
.upload-zone h4 { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
.upload-zone p { font-size: 13px; color: var(--gray-400); }
.upload-form { display: none; }
.upload-form.active { display: block; }
.form-row { margin-bottom: 16px; }
.form-group-upload { margin-bottom: 16px; }
.row .form-group-upload { margin-bottom: 0; }
.form-group-upload label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-group-upload input, .form-group-upload select, .form-group-upload textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; color: var(--gray-800); outline: none; transition: border-color 0.2s; background: var(--white); }
.form-group-upload input:focus, .form-group-upload select:focus { border-color: var(--navy-light); }
.form-group-upload textarea { resize: vertical; min-height: 80px; }
.selected-file { background: var(--blue-soft); border: 1px solid #bee3f8; border-radius: var(--radius-sm); padding: 12px 16px; display: none; align-items: center; gap: 10px; margin: 16px 0; }
.selected-file.show { display: flex; }
.selected-file span { font-size: 13px; color: var(--navy); font-weight: 500; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,38,66,0.5); display: none; align-items: center; justify-content: center; z-index: 999; backdrop-filter: blur(2px); }
.modal-overlay.show { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 90%; max-width: 560px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 22px 24px 0; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-header p { font-size: 13px; color: var(--gray-400); margin-top: 3px; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }

/* Toast */
.toast { position: fixed; bottom: 28px; right: 28px; background: var(--navy); color: var(--white); padding: 14px 22px; border-radius: var(--radius); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 9999; transform: translateY(80px); opacity: 0; transition: all 0.3s ease; display: flex; align-items: center; gap: 10px; }
.toast.show { transform: translateY(0); opacity: 1; }

/* Tags for all 7 bidang */
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.tag-umum { background: #eceff1; color: #455a64; }
.tag-keu { background: #e3f2fd; color: #1565c0; }
.tag-pem { background: #e3f2fd; color: #0d47a1; }
.tag-tran { background: #ffebee; color: #b71c1c; }
.tag-pmu { background: #e8f5e9; color: #1b5e20; }
.tag-sos { background: #fce4ec; color: #880e4f; }
.tag-pel { background: #fff8e1; color: #e65100; }

/* Alert Flash */
.alert-flash { padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; display: flex; align-items: center; gap: 8px; position: relative; }
.alert-flash .alert-close { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 16px; cursor: pointer; opacity: 0.6; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #a3d9b5; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #f5c6c2; }

/* Foto Grid */
.foto-grid { margin-bottom: 20px; }
.foto-card { border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all 0.2s; position: relative; }
.foto-card:hover { border-color: var(--navy-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.foto-thumb { width: 100%; height: 180px; overflow: hidden; background: var(--gray-100); }
.foto-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; transition: transform 0.3s; }
.foto-card:hover .foto-thumb img { transform: scale(1.05); }
.foto-info { padding: 12px 14px; }
.foto-title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.foto-meta { display: flex; align-items: center; gap: 8px; }
.foto-delete-btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.9); border: none; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 14px; opacity: 0; transition: opacity 0.2s; }
.foto-card:hover .foto-delete-btn { opacity: 1; }

/* Misc */
.month-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--gray-100); color: var(--gray-600); }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .es-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state h4 { font-size: 16px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--gray-400); }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.search-bar { flex: 1; min-width: 200px; padding: 9px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; outline: none; }
.search-bar:focus { border-color: var(--navy-light); }
.filter-select { padding: 9px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; outline: none; background: var(--white); cursor: pointer; }
.info-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--gold-pale); border: 1px solid #f0d080; border-radius: var(--radius-sm); padding: 7px 14px; font-size: 12px; color: #7a5c00; font-weight: 500; }
.page-section { display: none; }
.page-section.active { display: block; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.35s ease forwards; }

/* ===== RESPONSIVE MEDIA QUERIES ===== */

/* Untuk Tablet dan Layar Laptop Kecil (Maksimal 900px) */
@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { 
    width: 100%; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 40px 24px; 
  }
  .login-right > * { 
    width: 100%; 
    max-width: 440px; 
  }
  .sidebar { 
    width: 200px; 
  }
}

/* Untuk Tablet Portrait dan Mobile (Maksimal 768px) */
@media (max-width: 768px) {
  .app-body { 
    flex-direction: column; 
  }
  .sidebar { 
    width: 100%; 
    border-right: none; 
    border-bottom: 1px solid var(--gray-100); 
    padding: 8px 12px; 
    display: flex; 
    flex-direction: row; 
    overflow-x: auto; 
    white-space: nowrap; 
    gap: 8px; 
    scrollbar-width: none; /* Firefox */
  }
  .sidebar::-webkit-scrollbar { 
    display: none; /* Safari & Chrome */
  }
  .sidebar-section-label { 
    display: none; 
  }
  .nav-item { 
    padding: 8px 14px; 
    border-left: none; 
    border-bottom: 3px solid transparent; 
    border-radius: var(--radius-sm); 
    font-size: 13px; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .nav-item.active { 
    background: var(--blue-soft);
    color: var(--navy);
    border-left-color: transparent; 
    border-bottom-color: var(--navy); 
  }
  .main-content { 
    padding: 20px 16px; 
  }
  .header-brand h1 { 
    font-size: 15px; 
  }
  .header-right { 
    gap: 10px; 
  }
  .user-info { 
    display: none; /* Sembunyikan info teks untuk mencegah overflow */
  }
  
  /* Penyesuaian Halaman Modul Lainnya */
  .page-header-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .actions-bar {
    width: 100%;
  }
  .actions-bar > * {
    flex: 1;
  }
}
