/* =====================================================
   RAWBANK SIG - Global Stylesheet
   Architecture multi-pages ULT1-ULT12
   ===================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #003087;
  --primary-dark: #001d5c;
  --primary-light: #0057c8;
  --accent: #e8a000;
  --accent-dark: #c47f00;
  --success: #1a7a3c;
  --danger: #b91c1c;
  --warning: #d97706;
  --info: #0369a1;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Segoe UI', 'Arial', sans-serif;
  --transition: 0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: #e2e8f0; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ---------- Top Navigation Bar ---------- */
.topbar {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-brand .logo-circle {
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: var(--primary-dark);
  letter-spacing: -1px; flex-shrink: 0;
}
.topbar-brand .brand-text { font-size: 1.2rem; font-weight: 700; letter-spacing: 1px; }
.topbar-brand .brand-sub { font-size: 0.72rem; opacity: 0.75; letter-spacing: 0.5px; }
.topbar-user {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 0.9rem;
}
.topbar-user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--primary-dark);
  font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.4);
  overflow: hidden;
}
.topbar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-user .user-info { text-align: right; }
.topbar-user .user-name { font-weight: 600; font-size: 0.88rem; }
.topbar-user .user-role { font-size: 0.72rem; opacity: 0.75; }

/* ---------- Main Layout ---------- */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.page-title {
  font-size: 1.6rem; font-weight: 700; color: var(--primary-dark);
  display: flex; align-items: center; gap: 10px;
}
.page-title .icon { font-size: 1.8rem; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 1rem; font-weight: 700; color: var(--primary);
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.8rem;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  display: flex; align-items: center; gap: 1rem;
  transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-icon {
  font-size: 2rem; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(0,48,135,0.08);
}
.stat-info .stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); }
.stat-info .stat-label { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.48rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  font-weight: 600; font-size: 0.88rem;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-weight: 600; margin-bottom: 0.4rem;
  font-size: 0.85rem; color: var(--text);
}
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,48,135,0.12);
}
.form-control.error { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 0.78rem; margin-top: 3px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-actions {
  display: flex; gap: 0.8rem; justify-content: flex-end;
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.87rem;
}
.data-table th {
  background: var(--primary); color: #fff;
  padding: 0.7rem 1rem; text-align: left;
  font-weight: 600; font-size: 0.82rem; letter-spacing: 0.5px;
  white-space: nowrap;
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.data-table td {
  padding: 0.65rem 1rem; border-bottom: 1px solid #f1f5f9;
  color: var(--text); vertical-align: middle;
}
.data-table tr:hover td { background: #f8fafc; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .actions { display: flex; gap: 0.4rem; }

/* ---------- Badges / Status ---------- */
.badge {
  display: inline-block; padding: 0.22rem 0.65rem;
  border-radius: 20px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-primary { background: rgba(0,48,135,0.12); color: var(--primary-dark); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
}
.modal-box.modal-lg { max-width: 800px; }
.modal-box.modal-sm { max-width: 400px; }
.modal-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.35); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.8rem;
}

/* ---------- Alert / Toasts ---------- */
.alert {
  padding: 0.9rem 1.2rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; font-size: 0.88rem;
  display: flex; align-items: flex-start; gap: 10px;
  border-left: 4px solid;
}
.alert-success { background: #f0fdf4; border-color: var(--success); color: #166534; }
.alert-danger { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.alert-info { background: #eff6ff; border-color: var(--info); color: #1e40af; }

.toast-container {
  position: fixed; top: 80px; right: 1.5rem;
  z-index: 3000; display: flex; flex-direction: column; gap: 0.6rem;
}
.toast {
  background: #fff; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 0.9rem 1.3rem;
  min-width: 280px; max-width: 380px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideIn 0.25s ease; font-size: 0.88rem;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 1.2rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: #cbd5e1; }
.breadcrumb .current { color: var(--primary); font-weight: 600; }

/* ---------- Search / Filter Bar ---------- */
.search-bar {
  display: flex; gap: 0.8rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 1.2rem;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1rem; pointer-events: none;
}
.search-input-wrap input { padding-left: 2.2rem; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; font-size: 0.82rem; color: var(--text-muted);
}
.pagination-btns { display: flex; gap: 0.3rem; }
.pag-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.pag-btn:hover, .pag-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Print ---------- */
.print-header { display: none; }
@media print {
  .topbar, .breadcrumb, .btn, .search-bar, .pagination,
  .modal-overlay, .toast-container, .no-print { display: none !important; }
  .print-header { display: block; text-align: center; margin-bottom: 1rem; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { background: white; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .topbar { padding: 0 1rem; }
  .page-wrapper { padding: 1rem; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .data-table { font-size: 0.8rem; }
  .data-table td, .data-table th { padding: 0.5rem 0.6rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; } .gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.flex-between { justify-content: space-between; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Photo Upload Preview ---------- */
.photo-preview {
  width: 100px; height: 100px; border-radius: 50%;
  border: 3px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; margin: 0 auto 1rem;
  transition: border-color var(--transition);
  background: #f8fafc;
}
.photo-preview:hover { border-color: var(--primary); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .ph-icon { font-size: 2.5rem; color: var(--text-muted); }
