* { box-sizing: border-box; }
body{font-family:Poppins,system-ui,Segoe UI,Arial,sans-serif;margin:0;background:linear-gradient(to bottom right,#eef2f7 0%,#ffffff 100%);color:#1f2937;overflow-x:hidden}
img { max-width: 100%; height: auto; }
.bg{position:fixed;inset:0;z-index:-1;pointer-events:none;background:
  radial-gradient(1100px 600px at -200px -200px, rgba(59,130,246,.14), transparent 60%),
  radial-gradient(800px 400px at calc(100% + 150px) 100%, rgba(16,185,129,.12), transparent 60%);
}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;background:linear-gradient(135deg,#020617 0%,#111827 40%,#4b5563 100%);color:#f9fafb;border-bottom:3px solid #FFE800;position:sticky;top:0;z-index:1000}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;letter-spacing:.3px}
.logo{height:36px}
.menu-btn{display:none;margin-right:8px;height:36px;width:36px;border:1px solid #4b5563;border-radius:8px;background:#111827;color:#f9fafb}
.layout{display:grid;grid-template-columns:220px 1fr}
.sidebar{position:sticky;top:70px;width:220px;height:calc(100vh - 70px);background:linear-gradient(180deg,#05070f 0%,#0b1220 55%,#111827 100%);border-right:1px solid rgba(255,138,0,.18);padding:12px;overflow-y:auto;scrollbar-width:none}
.sidebar::-webkit-scrollbar{width:0;height:0}
.sidebar-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.sidebar-tool-btn{flex:1;min-width:96px;border:1px solid rgba(255,138,0,.35);background:rgba(2,6,23,.55);color:#ff8a00;font-weight:800;border-radius:12px;padding:8px 10px;cursor:pointer;box-shadow:0 8px 20px rgba(0,0,0,.35);text-shadow:0 0 14px rgba(255,138,0,.35)}
.sidebar-tool-btn.secondary{border-color:rgba(255,255,255,.18);color:#e5e7eb;background:rgba(17,24,39,.45);text-shadow:none}
.overlay{position:fixed;inset:0;background:rgba(17,24,39,.25);backdrop-filter:saturate(120%) blur(2px);display:none;z-index:999}
.sidebar .menu-group{margin-top:8px;padding:8px 8px;border-radius:14px;background:rgba(2,6,23,.35);border:1px solid rgba(255,138,0,.16);box-shadow:0 10px 26px rgba(0,0,0,.22)}
.sidebar nav a{display:block;color:#ff8a00;text-decoration:none;padding:8px 10px;border-radius:12px;margin-bottom:4px;transition:.15s ease;font-size:13px;line-height:1.2;text-shadow:0 0 14px rgba(255,138,0,.25)}
.sidebar nav a:hover{background:rgba(255,138,0,.10);box-shadow:0 0 0 1px rgba(255,138,0,.25) inset, 0 10px 22px rgba(0,0,0,.35)}
.sidebar .menu-section{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.12em;color:#ff8a00;margin:-2px -2px 8px -2px;padding:10px 10px;border-radius:12px;background:linear-gradient(90deg,#020617,#0b1220);border:1px solid rgba(255,138,0,.22);text-shadow:0 0 16px rgba(255,138,0,.35);cursor:pointer;user-select:none}
.sidebar .menu-section .menu-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;margin-right:6px;background:rgba(255,138,0,.14);color:#ff8a00;font-size:10px;font-weight:900}
.menu-group.collapsed a{display:none}
.menu-group .menu-section::after{content:'▾';font-weight:900;opacity:.9}
.menu-group.collapsed .menu-section::after{content:'▸'}
.content{margin-left:0}
.container{max-width:1100px;margin:0 auto;padding:24px}
.card{background:#ffffff;border:1px solid #e5e7eb;border-radius:16px;padding:18px;margin-bottom:18px;box-shadow:0 8px 24px rgba(17,24,39,.08)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}
.kpi{display:flex;align-items:center;justify-content:space-between}
.kpi .value{font-size:34px;font-weight:700;color:#111827}
.hero{background:linear-gradient(135deg,#f9fafb,#ffffff);border:1px solid #e5e7eb;border-radius:18px;padding:22px;margin-bottom:20px;position:relative}
.hero .title{font-size:28px;font-weight:700;color:#111827}
.hero .subtitle{color:#4b5563;margin-top:6px}
.hero .actions{margin-top:14px;display:flex;gap:10px;flex-wrap:wrap}
table{width:100%;border-collapse:separate;border-spacing:0;background:#ffffff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden}
th,td{padding:12px 10px;text-align:left}
thead th{background:#f3f4f6;color:#111827}
tbody tr:nth-child(odd){background:#ffffff}
tbody tr:nth-child(even){background:#f9fafb}
tbody tr:hover{background:#f3f4f6}
.btn{display:inline-block;padding:10px 14px;border-radius:10px;background:linear-gradient(90deg,#111827,#1f2937);color:#ffffff;text-decoration:none;box-shadow:0 8px 20px rgba(17,24,39,.35);transition:transform .15s ease,box-shadow .15s ease}
.btn:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(0,0,0,.45)}
.btn.secondary{background:linear-gradient(90deg,#9ca3af,#6b7280);color:#ffffff;box-shadow:0 8px 20px rgba(107,114,128,.25)}
.input{padding:12px;border:1px solid #cbd5e1;border-radius:10px;width:100%;background:#ffffff;color:#111827;outline:none;transition:border-color .15s ease,box-shadow .15s ease}
.input:focus{border-color:#60a5fa;box-shadow:0 0 0 3px rgba(96,165,250,.25)}
.row{display:flex;gap:12px;flex-wrap:wrap}
.footer{padding:16px;text-align:center;color:#f9fafb;display:flex;justify-content:center;align-items:center;gap:10px;background:linear-gradient(135deg,#000000 0%,#374151 100%);border-top:3px solid #FFE800}
.footer a{color:#e5e7eb}
.footer-logo{height:20px}
.badge{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px;line-height:1;background:#e5e7eb;color:#111827;margin-left:8px;border:1px solid #d1d5db}
.badge.verified{background:#10b981;color:#ffffff;border-color:#0ea5e9}
.toast{position:fixed;bottom:20px;right:20px;background:#111827;color:#ffffff;padding:12px 14px;border-radius:10px;box-shadow:0 12px 28px rgba(17,24,39,.25);z-index:2000;opacity:.95}
.toast.success{background:#10b981}
.toast.error{background:#ef4444}
.voided-row { color: #9ca3af; background: #f9fafb; text-decoration: line-through; }
.voided-badge { background: #6b7280; color: #ffffff; }
@media (max-width: 820px){
  .menu-btn{display:inline-block}
  .layout{grid-template-columns:1fr}
  .sidebar{position:fixed;top:0;left:0;width:240px;height:100vh;transform:translateX(-100%);transition:transform .2s ease;box-shadow:0 8px 24px rgba(17,24,39,.2);z-index:1000}
  .topbar{padding:10px 16px}
  .content{margin-left:0}
  body.sidebar-open .sidebar{transform:translateX(0)}
  body.sidebar-open .overlay{display:block}
}

/* Responsive Table Styles */
@media screen and (max-width: 768px) {
  table { border: 0; }
  table caption { font-size: 1.3em; }
  table thead { display: none; }
  table tr { border-bottom: 3px solid #ddd; display: block; margin-bottom: .625em; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
  table td { border-bottom: 1px solid #ddd; display: block; font-size: .8em; text-align: right; position: relative; padding-left: 50%; min-height: 40px; word-wrap: break-word; }
  table td::before { content: attr(data-label); position: absolute; left: 10px; width: 45%; text-align: left; font-weight: bold; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; top: 12px; }
  table td:last-child { border-bottom: 0; }
  
  /* Specific adjustments */
  .container { padding: 12px; }
  .card { padding: 12px; overflow-x: hidden; }
}

/* Print Styles: Ensure clean PDFs with AKGym branding and visible Amount column */
@media print {
  html, body { font-size: 10pt !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #ffffff !important; color: #111827; }
  .topbar { background: #0b1220 !important; color: #f9fafb !important; border-bottom: 3px solid #FFE800 !important; }
  .footer { background: #0b1220 !important; color: #f9fafb !important; border-top: 3px solid #FFE800 !important; }
  .sidebar, .overlay, .menu-btn, .toast, .hero .actions, .btn, .modal, .modal-box { display: none !important; }
  .layout, .content, .container, .card { box-shadow: none !important; border: 0 !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .hero { border: 0 !important; background: #ffffff !important; padding: 0 !important; margin: 0 0 8px 0 !important; }
  .hero .title { font-size: 14pt !important; }
  .hero .subtitle { color: #374151 !important; }

  table { width: 100% !important; border-collapse: collapse !important; border: 1px solid #d1d5db !important; background: #ffffff !important; }
  thead { display: table-header-group !important; }
  tfoot { display: table-footer-group !important; }
  thead th { background: #f3f4f6 !important; color: #111827 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 11pt !important; }
  th, td { border: 1px solid #e5e7eb !important; padding: 6px 8px !important; color: #111827 !important; }
  tr, img { break-inside: avoid !important; page-break-inside: avoid !important; }
  .badge, .menu-section, .menu-icon { display: none !important; }

  th.amount, td.amount { display: table-cell !important; text-align: right !important; white-space: nowrap !important; min-width: 24mm !important; font-weight: 700; }
  .text-income { color: #065f46 !important; }
  .text-expense { color: #b91c1c !important; }

  .voided-row { color: #6b7280 !important; background: #f9fafb !important; text-decoration: line-through !important; }
  .voided-badge { display: inline-block !important; background: #6b7280 !important; color: #ffffff !important; }

  @page { size: A4 portrait; margin: 14mm 12mm; }
  table thead { display: table-header-group !important; }
  table tr { display: table-row !important; }
  table td, table th { display: table-cell !important; text-align: left !important; padding-left: 10px !important; }
  table td::before { content: none !important; }
}
