/* ============================================================
   UmrohSenang - Sahabat Mata
   Main Stylesheet — Islamic Elegant Theme
   Mobile-First, WebView-Ready, Responsive
   ============================================================ */

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

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand Colors */
  --primary:        #1B4D3E;  /* Deep Islamic Green */
  --primary-dark:   #0F2E24;
  --primary-light:  #2E7D5A;
  --accent:         #C9A84C;  /* Gold */
  --accent-light:   #F0D080;
  --accent-dark:    #9B7A2E;

  /* Neutrals */
  --surface:        #FFFFFF;
  --surface-2:      #F8F9FA;
  --surface-3:      #F0F4F2;
  --border:         #E2E8E4;
  --text:           #1A2E25;
  --text-secondary: #5A7060;
  --text-muted:     #9BB0A0;

  /* Status */
  --success:  #2E7D32;
  --warning:  #E65100;
  --danger:   #C62828;
  --info:     #1565C0;
  --success-bg: #E8F5E9;
  --warning-bg: #FFF3E0;
  --danger-bg:  #FFEBEE;
  --info-bg:    #E3F2FD;

  /* Layout */
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    20px;
  --shadow:       0 2px 12px rgba(27,77,62,.08);
  --shadow-md:    0 4px 24px rgba(27,77,62,.12);
  --shadow-lg:    0 8px 40px rgba(27,77,62,.16);

  /* Transitions */
  --trans: .2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', serif;
  line-height: 1.3;
  color: var(--primary-dark);
}
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }

.arabic-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  direction: rtl;
  color: var(--accent);
  letter-spacing: .05em;
}

/* ============================================================
   LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary-dark);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform var(--trans);
}

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

.sidebar-brand .brand-icon {
  width: 52px; height: 52px;
  background: var(--accent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.6rem;
}

.sidebar-brand .brand-name {
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  color: var(--accent-light);
  font-size: .7rem;
  opacity: .8;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  padding: 10px 20px 4px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.35);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.75);
  font-size: .88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--trans);
  position: relative;
}

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

.nav-item.active {
  background: rgba(201,168,76,.12);
  color: var(--accent-light);
  border-left-color: var(--accent);
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* Sub-menu */
.nav-sub {
  padding-left: 32px;
}

.nav-sub .nav-item {
  font-size: .83rem;
  padding: 8px 20px 8px 0;
  border-left: none;
  border-left-color: transparent;
}

/* Sidebar User */
.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user .user-name {
  color: #fff;
  font-size: .83rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-user .user-role {
  color: var(--accent-light);
  font-size: .7rem;
  opacity: .8;
}

.sidebar-user .logout-btn {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: none;
  color: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  transition: all var(--trans);
}

.sidebar-user .logout-btn:hover {
  background: rgba(198,40,40,.3);
  color: #fff;
}

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

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  gap: 12px;
}

.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 14px;
  gap: 8px;
  width: 220px;
  transition: all var(--trans);
}

.topbar-search:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,125,90,.1);
  width: 280px;
}

.topbar-search input {
  border: none;
  background: none;
  font-size: .85rem;
  width: 100%;
  outline: none;
  color: var(--text);
}

.topbar-search .search-icon {
  color: var(--text-muted);
  font-size: .9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--trans);
}

.topbar-btn:hover {
  background: var(--surface-3);
  color: var(--primary);
  border-color: var(--primary-light);
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

/* Page Content */
.page-content {
  flex: 1;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header .page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--primary-dark);
}

.page-header .page-subtitle {
  font-size: .85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .5; }

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

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

.card-header .card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  flex: 1;
}

.card-header .card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

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

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: all var(--trans);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.green::before  { background: var(--primary); }
.stat-card.gold::before   { background: var(--accent); }
.stat-card.blue::before   { background: var(--info); }
.stat-card.orange::before { background: var(--warning); }

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

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

.stat-card.green .stat-icon  { background: var(--success-bg); }
.stat-card.gold .stat-icon   { background: #FFF8E1; }
.stat-card.blue .stat-icon   { background: var(--info-bg); }
.stat-card.orange .stat-icon { background: var(--warning-bg); }

.stat-info { flex: 1; min-width: 0; }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.1;
}

.stat-label {
  font-size: .78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-change {
  font-size: .75rem;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.data-table thead {
  background: var(--surface-3);
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover {
  background: var(--surface-3);
}

.data-table .td-name {
  font-weight: 600;
  color: var(--primary-dark);
}

.data-table .td-muted { color: var(--text-muted); font-size: .8rem; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-muted    { background: var(--surface-3);  color: var(--text-secondary); }
.badge-primary  { background: rgba(27,77,62,.1); color: var(--primary); }
.badge-gold     { background: #FFF8E1; color: var(--accent-dark); }

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

.form-label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text);
  background: var(--surface);
  transition: all var(--trans);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,125,90,.12);
}

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }

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

.form-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='%235A7060' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: .75rem; color: var(--danger); margin-top: 5px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

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

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

.upload-area:hover, .upload-area.dragover {
  border-color: var(--primary-light);
  background: rgba(46,125,90,.05);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #B71C1C; }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-sm  { padding: 7px 13px; font-size: .8rem; }
.btn-lg  { padding: 13px 24px; font-size: .95rem; }
.btn-icon { padding: 9px; }
.btn-block { width: 100%; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-success { background: var(--success-bg); border-color: #A5D6A7; color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: #FFCC80; color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  border-color: #EF9A9A; color: var(--danger); }
.alert-info    { background: var(--info-bg);    border-color: #90CAF9; color: var(--info); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-link {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: .83rem;
  color: var(--text-secondary);
  transition: all var(--trans);
}

.page-link:hover { background: var(--surface-3); color: var(--primary); border-color: var(--primary-light); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--trans);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

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

/* Desktop modal style */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: var(--radius-lg);
    transform: translateY(20px) scale(.97);
  }
  .modal-overlay.open .modal {
    transform: translateY(0) scale(1);
  }
  .modal-handle { display: none; }
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 6px; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -24px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.timeline-dot.done   { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.active { background: var(--accent);  box-shadow: 0 0 0 2px var(--accent); }
.timeline-dot.fail   { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }

/* ============================================================
   LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 340px;
}

.toast {
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
  font-size: .875rem;
}

.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); }
.toast.danger  { background: var(--danger); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   ISLAMIC DECORATIVE ELEMENTS
   ============================================================ */
.ornament {
  text-align: center;
  color: var(--accent);
  font-size: 1.2rem;
  opacity: .6;
  letter-spacing: .3em;
}

.divider-ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: .75rem;
  margin: 20px 0;
}
.divider-ornament::before, .divider-ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.auth-left {
  flex: 1;
  background: var(--primary-dark);
  position: relative;
  overflow: hidden;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.auth-left .bg-pattern {
  position: absolute;
  inset: 0;
  background: url('/assets/img/islamic-pattern.svg') repeat;
  opacity: .04;
}

.auth-right {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
}

@media (min-width: 960px) {
  .auth-left  { display: flex; }
  .auth-right { width: 440px; }
}

/* ============================================================
   JAMAAH PORTAL (mobile-first)
   ============================================================ */
.portal-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface-2);
  position: relative;
}

.portal-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 20px 20px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.portal-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 30px;
  background: var(--surface-2);
  border-radius: 30px 30px 0 0;
}

.portal-header .greeting {
  font-size: .85rem;
  opacity: .8;
}

.portal-header .portal-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-top: 2px;
}

.portal-header .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .75rem;
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.2);
}

.portal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  margin: -10px 16px 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.portal-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  height: 60px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}

.portal-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: .62rem;
  font-weight: 600;
  padding: 8px 4px;
  border-top: 2px solid transparent;
  transition: all var(--trans);
}

.portal-nav-item.active {
  color: var(--primary);
  border-top-color: var(--primary);
}

.portal-nav-item .nav-ico { font-size: 1.2rem; }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--trans);
  }

  .sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .main-content { margin-left: 0; }
  .menu-toggle  { display: flex; }

  .page-content { padding: 16px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .stat-value { font-size: 1.3rem; }

  .topbar-search { display: none; }

  .form-grid { grid-template-columns: 1fr; }

  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 10px 12px; }

  .page-header { flex-direction: column; gap: 10px; }

  .toast-container { bottom: 70px; right: 12px; left: 12px; max-width: 100%; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .topbar, .portal-nav { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.flex          { display: flex; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.text-sm   { font-size: .85rem; }
.text-xs   { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden-mobile { display: none; }
@media (min-width: 769px) { .hidden-mobile { display: block; } }

/* ── MODAL OVERLAY ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface-3); }
.modal-body   { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── FILTER ROW ──────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
