/* =============================================
   Arsip Digital UMSU - Main Stylesheet
   Design: Institutional Clean + Modern
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

:root {
  --primary:       #1B3A6B;   /* UMSU Navy */
  --primary-dark:  #122847;
  --primary-light: #2D5BA0;
  --accent:        #C8A84B;   /* UMSU Gold */
  --accent-light:  #E8C96A;
  --surface:       #F7F8FC;
  --white:         #FFFFFF;
  --text-main:     #1A1D2E;
  --text-muted:    #6B7280;
  --text-light:    #9CA3AF;
  --border:        #E5E7EB;
  --danger:        #DC2626;
  --success:       #16A34A;
  --warning:       #D97706;
  --info:          #2563EB;
  --sidebar-w:     260px;
  --header-h:      64px;
  --radius:        10px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 16px rgba(27,58,107,.10);
  --shadow-lg:     0 8px 32px rgba(27,58,107,.16);
  --transition:    all .2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--surface);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(200,168,75,.08);
  top: -200px; right: -150px;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -100px; left: -100px;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(27,58,107,.3);
}

.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--primary);
  line-height: 1.3;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-text h2 {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-text span {
  color: var(--accent-light);
  font-size: 11px;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-user .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 13px;
  flex-shrink: 0;
}

.user-details h4 {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}

.user-details .role-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.role-superadmin { background: rgba(200,168,75,.25); color: var(--accent-light); }
.role-admin       { background: rgba(45,91,160,.35);  color: #93C5FD; }
.role-pengunjung  { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
}

.nav-item a:hover,
.nav-item a.active {
  color: var(--white);
  background: rgba(255,255,255,.06);
  border-left-color: var(--accent);
}

.nav-item a .nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.sidebar-footer a:hover {
  background: rgba(220,38,38,.15);
  color: #FCA5A5;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.topbar-left p {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-body { padding: 28px; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.card-body { padding: 22px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

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

.stat-icon.blue   { background: rgba(37,99,235,.1);  color: #2563EB; }
.stat-icon.gold   { background: rgba(200,168,75,.12); color: var(--accent); }
.stat-icon.green  { background: rgba(22,163,74,.1);  color: var(--success); }
.stat-icon.red    { background: rgba(220,38,38,.1);  color: var(--danger); }
.stat-icon.navy   { background: rgba(27,58,107,.1);  color: var(--primary); }

.stat-info h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-info p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,58,107,.08);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control { cursor: pointer; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 20px;
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(27,58,107,.3); }

.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: #B8923C; }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #15803D; }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #B91C1C; }

.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #B45309; }

.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(27,58,107,.04); }

.btn-outline-primary { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: var(--white); }

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--surface);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(27,58,107,.025); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.badge-success { background: rgba(22,163,74,.1);  color: #15803D; }
.badge-danger  { background: rgba(220,38,38,.1);  color: #B91C1C; }
.badge-warning { background: rgba(217,119,6,.1);  color: #92400E; }
.badge-info    { background: rgba(37,99,235,.1);  color: #1D4ED8; }
.badge-primary { background: rgba(27,58,107,.1);  color: var(--primary); }
.badge-gold    { background: rgba(200,168,75,.15); color: #92680A; }
.badge-gray    { background: rgba(107,114,128,.1); color: #4B5563; }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: var(--white);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.search-bar .search-field { flex: 1; min-width: 220px; }
.search-bar .filter-field { min-width: 160px; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 16px;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
  text-decoration: none;
}

.page-item:hover { border-color: var(--primary); color: var(--primary); }
.page-item.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-item.disabled { opacity: .4; cursor: not-allowed; }

/* ===== FLASH MESSAGES ===== */
.flash {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-success { background: rgba(22,163,74,.1);  color: #166534; border: 1px solid rgba(22,163,74,.2); }
.flash-error   { background: rgba(220,38,38,.1);  color: #991B1B; border: 1px solid rgba(220,38,38,.2); }
.flash-warning { background: rgba(217,119,6,.1);  color: #92400E; border: 1px solid rgba(217,119,6,.2); }
.flash-info    { background: rgba(37,99,235,.1);  color: #1E40AF; border: 1px solid rgba(37,99,235,.2); }

/* ===== UPLOAD AREA ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary);
  background: rgba(27,58,107,.03);
}

.upload-area .upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-area h4 { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.upload-area p  { font-size: 12px; color: var(--text-muted); }

/* ===== ACTION BUTTONS GROUP ===== */
.action-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: .5; }
.empty-state h3 { color: var(--text-muted); font-size: 16px; margin-bottom: 8px; }
.empty-state p  { color: var(--text-light); font-size: 13px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--primary); }

.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
}
