/* ============================================================
   AMAS — Association Management & Accounting System
   Admin Panel Theme  (Bootstrap 5 compatible)
   File: assets/css/style.css
   Designed to be easily ported into Laravel Blade layouts.
   ============================================================ */

:root {
  --amas-primary: #1e3a5f;      /* deep navy */
  --amas-primary-light: #2c5282;
  --amas-accent: #2b6cb0;       /* blue accent */
  --amas-success: #2f855a;
  --amas-warning: #dd6b20;
  --amas-danger: #c53030;
  --amas-info: #3182ce;
  --amas-bg: #f4f6f9;
  --amas-sidebar: #16263d;
  --amas-sidebar-hover: #1e3a5f;
  --amas-sidebar-active: #2b6cb0;
  --amas-text: #2d3748;
  --amas-muted: #718096;
  --amas-border: #e2e8f0;
  --amas-card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --amas-radius: .5rem;
}

* { box-sizing: border-box; }

body {
  background: var(--amas-bg);
  color: var(--amas-text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  margin: 0;
  overflow-x: hidden;
}

a { text-decoration: none; }

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

/* ---------- Sidebar ---------- */
.sidebar {
  width: 250px;
  background: var(--amas-sidebar);
  color: #cbd5e0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, width .25s ease;
  z-index: 1040;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #3a4a5e; border-radius: 4px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: .5px;
}
.sidebar-brand .logo-box {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: #fff; font-size: 18px;
}
.sidebar-brand .logo-box img{max-width: 35px}
.sidebar-brand small { display:block; font-size:10px; font-weight:400; color:#90a4bd; letter-spacing:1px; }

.sidebar-section {
  padding: 14px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #6b7c93;
  font-weight: 700;
}

.sidebar-nav { list-style: none; margin: 0; padding: 0 10px; }
.sidebar-nav .nav-item { margin-bottom: 2px; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e0;
  border-radius: 8px;
  font-size: 16px;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--amas-sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active {
  background: var(--amas-sidebar-active);
  color: #fff;
  font-weight: 600;
}
.sidebar-nav .nav-link .badge { margin-left: auto; }
.sidebar-nav .submenu { list-style: none; padding-left: 18px; margin: 0; }
.sidebar-nav .submenu .nav-link { font-size: 16px; padding: 8px 14px; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 16px;
  color: #6b7c93;
}

/* ---------- Main Content ---------- */
.main-content {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- Top Navbar ---------- */
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--amas-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1030;
  gap: 14px;
}
.topbar .toggle-btn {
  border: none; background: transparent; font-size: 20px; color: var(--amas-text);
  cursor: pointer; display: none;
}
.topbar .page-title-sm { font-weight: 600; font-size: 16px; }
.topbar .search-box {
  flex: 1; max-width: 360px; position: relative;
}
.topbar .search-box input {
  width: 100%; border: 1px solid var(--amas-border); border-radius: 20px;
  padding: 7px 14px 7px 36px; font-size: 16px; background: #f8fafc;
}
.topbar .search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--amas-muted); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border: 1px solid var(--amas-border);
  background: #fff; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--amas-text); cursor: pointer;
}
.icon-btn:hover { background: #f1f5f9; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; background: var(--amas-danger);
  border-radius: 50%; border: 2px solid #fff;
}

.user-dropdown { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.user-dropdown:hover { background: #f1f5f9; }
.user-dropdown img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-dropdown .u-meta { line-height: 1.1; }
.user-dropdown .u-meta .name { font-weight: 600; font-size: 16px; }
.user-dropdown .u-meta .role { font-size: 16px; color: var(--amas-muted); }

/* ---------- Dropdown menus ---------- */
.dropdown-menu.amas-menu {
  border: none; box-shadow: 0 10px 30px rgba(0,0,0,.12); border-radius: 12px; padding: 6px; min-width: 240px;
}
.dropdown-menu.amas-menu .dropdown-header { font-size: 15px; color: var(--amas-muted); }
.dropdown-item { border-radius: 8px; font-size: 16px; padding: 8px 12px; }
.dropdown-item:hover { background: #eef2f7; }
.notif-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; }
.notif-item:hover { background: #f1f5f9; }
.notif-item i { font-size: 18px; }
.notif-item .n-text { font-size: 16px; }
.notif-item .n-time { font-size: 16px; color: var(--amas-muted); }

/* ---------- Page Content ---------- */
.page-content { padding: 24px; flex: 1; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.page-head h1 { font-size: 22px; font-weight: 700; margin: 0; }
.page-head .subtitle { color: var(--amas-muted); font-size: 16px; margin: 2px 0 0; }

.breadcrumb-amas {
  background: transparent; padding: 0; margin: 0 0 18px; font-size: 16px;
}
.breadcrumb-amas .breadcrumb-item a { color: var(--amas-accent); }
.breadcrumb-amas .breadcrumb-item.active { color: var(--amas-muted); }

/* ---------- Cards ---------- */
.card-amas {
  background: #fff; border: 1px solid var(--amas-border);
  border-radius: var(--amas-radius); box-shadow: var(--amas-card-shadow);
  margin-bottom: 20px;
}
.card-amas .card-header-amas {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--amas-border);
}
.card-amas .card-header-amas h5 { margin: 0; font-size: 15px; font-weight: 600; }
.card-amas .card-header-amas .card-actions { display: flex; gap: 8px; }
.card-amas .card-body-amas { padding: 18px; }

/* Stat cards */
.stat-card {
  background: #fff; border: 1px solid var(--amas-border);
  border-radius: var(--amas-radius); padding: 18px; box-shadow: var(--amas-card-shadow);
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  border-left: 4px solid var(--amas-accent);
}
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px; color: #fff;
}
.stat-card .stat-meta .value { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-card .stat-meta .label { font-size: 15px; color: var(--amas-muted); margin-top: 4px; }
.stat-card .stat-meta .trend { font-size: 16px; margin-top: 4px; }
.stat-card.success { border-left-color: var(--amas-success); }
.stat-card.warning { border-left-color: var(--amas-warning); }
.stat-card.danger  { border-left-color: var(--amas-danger); }
.stat-card.info    { border-left-color: var(--amas-info); }

/* ---------- Buttons ---------- */
.btn-amas-primary { background: var(--amas-primary); border-color: var(--amas-primary); color: #fff; }
.btn-amas-primary:hover { background: var(--amas-primary-light); color: #fff; }
.btn-sm-ico { padding: .25rem .5rem; }

/* ---------- Tables ---------- */
.table-responsive{
  min-height: 400px;
}
.table-amas { margin: 0; }
.table-amas thead th {
  background: #f8fafc; font-size: 15px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--amas-muted); border-bottom: 2px solid var(--amas-border);
  white-space: nowrap; padding: 12px 14px;
}
.table-amas tbody td { padding: 12px 14px; vertical-align: middle; font-size: 16px; border-color: #edf2f7; }
.table-amas tbody tr:hover { background: #f8fafc; }
.table-amas .row-actions .dropdown-toggle::after { display: none; }

/* ---------- Badges ---------- */
.badge-amas { font-size: 16px; font-weight: 600; padding: .35em .7em; border-radius: 20px; }
.badge-active   { background: #e6fffa; color: var(--amas-success); }
.badge-inactive { background: #f7fafc; color: var(--amas-muted); }
.badge-pending  { background: #fffaf0; color: var(--amas-warning); }
.badge-suspended{ background: #fff5f5; color: var(--amas-danger); }
.badge-resigned { background: #edf2f7; color: #4a5568; }
.badge-migrated { background: #ebf8ff; color: var(--amas-info); }
.badge-paid     { background: #e6fffa; color: var(--amas-success); }
.badge-due      { background: #fff5f5; color: var(--amas-danger); }

/* ---------- Forms ---------- */
.form-label-amas { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.form-control, .form-select { font-size: 16px; border-radius: 8px; min-height: 50px; border-color: var(--amas-border); }
.form-control:focus, .form-select:focus { border-color: var(--amas-accent); box-shadow: 0 0 0 .2rem rgba(43,108,176,.15); }
.form-section-title { font-size: 16px; font-weight: 700; color: var(--amas-primary); text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 14px; border-bottom: 1px dashed var(--amas-border); padding-bottom: 8px; }
.invalid-feedback-amas { font-size: 16px; color: var(--amas-danger); }

/* ---------- Filters bar ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: #fff; border: 1px solid var(--amas-border); border-radius: var(--amas-radius);
  padding: 14px; margin-bottom: 18px;
}
.filter-bar .form-group { margin: 0; }
.filter-bar label { font-size: 16px; color: var(--amas-muted); margin-bottom: 4px; display: block; }

/* ---------- Pagination ---------- */
.pagination-amas .page-link { font-size: 16px; border-radius: 6px; margin: 0 2px; color: var(--amas-accent); }
.pagination-amas .page-item.active .page-link { background: var(--amas-primary); border-color: var(--amas-primary); color: #fff; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--amas-muted); }
.empty-state i { font-size: 44px; color: #cbd5e0; }
.empty-state h6 { margin: 14px 0 4px; color: var(--amas-text); }
.empty-state p { font-size: 16px; margin: 0; }

/* ---------- Loading state ---------- */
.loading-state { text-align:center; padding: 40px; color: var(--amas-muted); }
.spinner-amas { width: 2.2rem; height: 2.2rem; }

/* ---------- Auth pages ---------- */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16263d 0%, #2b6cb0 100%); padding: 20px;
}
.auth-card {
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 420px; overflow: hidden;
}
.auth-card .auth-header { background: var(--amas-primary); color: #fff; padding: 28px; text-align: center; }
.auth-card .auth-header .logo-box { display: inline-grid; place-items: center; margin-bottom: 10px; }
.auth-card .auth-header .logo-box img{max-width: 100px; max-height: 100px; object-fit: contain;}
.auth-card .auth-body {background: #fff; padding: 28px; }

/* ---------- Profile ---------- */
.profile-cover { height: 120px; background: linear-gradient(135deg, var(--amas-primary), var(--amas-accent)); border-radius: var(--amas-radius) var(--amas-radius) 0 0; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid #fff; margin-top: -48px; background: #cbd5e0; object-fit: cover; }
.profile-avatar-empty { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #64748b; font-size: 12px; line-height: 1.15; text-align: center; }
.profile-avatar-empty i { font-size: 26px; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--amas-border); font-size: 16px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--amas-muted); }
.info-row .v { font-weight: 600; }

/* ---------- Timeline (audit) ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content:''; position:absolute; left:7px; top:0; bottom:0; width:2px; background: var(--amas-border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content:''; position:absolute; left:-21px; top:3px; width:12px; height:12px; border-radius:50%; background: var(--amas-accent); border:2px solid #fff; box-shadow:0 0 0 2px var(--amas-border); }

/* ---------- Utility ---------- */
.text-muted-amas { color: var(--amas-muted) !important; }
.fs-12 { font-size: 14px; }
.fs-13 { font-size: 16px; }
.fw-600 { font-weight: 600; }
.nowrap { white-space: nowrap; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* ---------- Image upload preview ---------- */
.img-uploader {
  position: relative;
  border: 2px dashed var(--amas-border);
  border-radius: var(--amas-radius);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.img-uploader:hover { border-color: var(--amas-accent); background: #eef5fc; }
.img-uploader input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-uploader .iu-icon { font-size: 26px; color: var(--amas-muted); }
.img-uploader .iu-text { font-size: 15px; color: var(--amas-muted); margin-top: 4px; }
.img-uploader .iu-preview {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; display: none;
}
.img-uploader.has-image .iu-icon,
.img-uploader.has-image .iu-text { display: none; }
.img-uploader.has-image .iu-preview { display: block; }
.img-uploader .iu-remove {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: rgba(197,48,48,.92); color: #fff; font-size: 15px; display: none;
}
.img-uploader.has-image .iu-remove { display: block; }
.img-uploader.photo-box { width: 130px; height: 150px; }
.img-uploader.photo-box:not(.has-image) { background: #e5e7eb; }
.img-uploader.sign-box { width: 100%; height: 120px; }

/* ---------- Membership print layout (A4) ---------- */
.print-sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: #fff;
  padding: 12mm 12mm;
  color: #1a202c;
  font-size: 15px;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.print-sheet .ps-header {
  display: flex; align-items: center; gap: 14px;
  border-bottom: 3px solid var(--amas-primary);
  padding-bottom: 10px; margin-bottom: 14px;
}
.print-sheet .ps-logo {
  width: 56px; height: 56px; border-radius: 10px;
  background: var(--amas-primary); color: #fff;
  display: grid; place-items: center; font-size: 28px; flex: none;
}
.print-sheet .ps-org { font-size: 18px; font-weight: 800; line-height: 1.1; }
.print-sheet .ps-org small { display: block; font-size: 16px; font-weight: 500; color: #4a5568; }
.print-sheet .ps-title {
  margin-left: auto; text-align: right;
}
.print-sheet .ps-title h2 { font-size: 16px; margin: 0; font-weight: 800; letter-spacing: .5px; }
.print-sheet .ps-title .ps-id { font-size: 16px; font-weight: 700; color: var(--amas-accent); }

.print-sheet .ps-photo {
  width: 130px; height: 150px; object-fit: cover;
  border: 1px solid #cbd5e0; border-radius: 6px; background: #f1f5f9;
}
.print-sheet .ps-sign {
  width: 200px; height: 70px; object-fit: contain; background: #fff;
  border: 1px solid #cbd5e0; border-radius: 4px;
}

.print-sheet .ps-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px;
}
.print-sheet .ps-field { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dotted #e2e8f0; }
.print-sheet .ps-field .ps-k { width: 42%; color: #4a5568; font-weight: 600; }
.print-sheet .ps-field .ps-v { flex: 1; font-weight: 700; }

.print-sheet .ps-section { font-weight: 800; font-size: 16px; margin: 16px 0 6px; color: var(--amas-primary); text-transform: uppercase; letter-spacing: .5px; }
.print-sheet table.ps-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.print-sheet table.ps-table th, .print-sheet table.ps-table td { border: 1px solid #cbd5e0; padding: 6px 8px; text-align: left; }
.print-sheet table.ps-table th { background: #f1f5f9; }

.print-sheet .ps-qr {
  width: 90px; height: 90px; border: 1px solid #cbd5e0; border-radius: 6px;
  display: grid; place-items: center; color: #718096; font-size: 16px; text-align: center;
  background-image:
    repeating-linear-gradient(0deg, #2d3748 0 2px, transparent 2px 4px, #2d3748 4px 6px, transparent 6px 9px),
    repeating-linear-gradient(90deg, #2d3748 0 2px, transparent 2px 4px, #2d3748 4px 6px, transparent 6px 9px);
  background-size: 9px 9px;
}
.print-sheet .ps-footer { margin-top: 22px; display: flex; justify-content: space-between; gap: 30px; }
.print-sheet .ps-sign-block { flex: 1; text-align: center; }
.print-sheet .ps-sign-block .ps-line { border-top: 1px solid #2d3748; margin-top: 38px; padding-top: 4px; font-size: 16px; }

/* ---------- Print rules (only the A4 sheet prints) ---------- */
@media print {
  body { background: #fff; }
  .app-wrapper, .sidebar, .sidebar-overlay, .topbar, .page-content,
  .main-content .page-head, #screenView { display: none !important; }
  #printArea { display: block !important; }
  .print-sheet { width: auto; min-height: auto; margin: 0; box-shadow: none; padding: 0; }
  @page { size: A4; margin: 12mm; }
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 1000px rgba(0,0,0,.4); }
  .main-content { margin-left: 0; }
  .topbar .toggle-btn { display: block; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; display: none; }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 575.98px) {
  .page-content { padding: 14px; }
  .topbar .search-box { display: none; }
  .user-dropdown .u-meta { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* Print styles - only the membership sheet prints (blank page fix) */
@media print {
  .sidebar, .topbar, .page-head, .breadcrumb, #profileContent, .modal, nav, footer, .btn { display: none !important; }
  body { background: #fff !important; }
  #printArea { display: block !important; }
  .print-sheet { font-size: 12px; color: #000; max-width: 800px; margin: 0 auto; }
  .ps-field { margin-bottom: 4px; }
  .ps-k { font-weight: 600; display: inline-block; min-width: 130px; }
}

