/* Tarun Sangha Club Management System - Modern UI Theme */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.5; }

.app-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 260px; background: var(--bg-sidebar); color: white; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 24px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #1e293b; }
.brand-logo { font-size: 28px; background: #1e293b; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.brand-text h2 { font-size: 16px; font-weight: 700; color: #f8fafc; letter-spacing: 0.5px; }
.brand-text span { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-menu { padding: 20px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #94a3b8; text-decoration: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.nav-link:hover { background: var(--bg-sidebar-hover); color: white; }
.nav-link.active { background: var(--primary); color: white; font-weight: 600; box-shadow: 0 4px 12px rgba(2,132,199,0.3); }
.nav-link .icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer { padding: 20px; border-top: 1px solid #1e293b; }
.db-pill { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #38bdf8; text-decoration: none; padding: 10px 12px; background: #1e293b; border-radius: 6px; }
.db-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.db-pill .dot.offline { background: #eab308; }
.copyright { font-size: 11px; color: #64748b; margin-top: 10px; text-align: center; }

/* Main Content */
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.topbar-title { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.bengali-tag { font-weight: 700; color: var(--primary); font-size: 16px; margin-right: 6px; }
.topbar-date { font-size: 13px; color: var(--text-muted); }

.content-area { padding: 32px; flex: 1; }

/* Common Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--text-main); }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* Buttons */
.btn { padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: white; border: 1px solid #cbd5e1; color: #334155; }
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { background: none; border: none; font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.btn-icon:hover { background: #f1f5f9; }

/* Cards & Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: white; padding: 22px; border-radius: 12px; border: 1px solid var(--border); display: flex; align-items: center; gap: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-info .label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat-info .val { font-size: 24px; font-weight: 700; color: var(--text-main); margin: 2px 0; }
.stat-info .sub { font-size: 12px; font-weight: 500; }

.card { background: white; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.04); overflow: hidden; margin-bottom: 24px; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { background: #f8fafc; padding: 12px 18px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px 18px; font-size: 13px; color: #334155; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tr:hover { background: #fafafa; }

/* Badges */
.badge { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; display: inline-block; }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-yellow { background: var(--warning-bg); color: var(--warning); }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Status pill */
.status-pill { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; display: inline-block; }
.status-pill.active { background: var(--success-bg); color: var(--success); }
.status-pill.inactive { background: #f1f5f9; color: #64748b; }
.status-pill.suspended { background: var(--danger-bg); color: var(--danger); }

/* Toolbar */
.toolbar { display: flex; gap: 16px; background: white; padding: 14px 20px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 20px; }
.search-input { flex: 1; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; }
.select-input { padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; background: white; }

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-window { background: white; border-radius: 12px; width: 600px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2); }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.modal-content { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: #f8fafc; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 12px; font-weight: 600; color: #475569; }
.form-field input, .form-field select, .form-field textarea { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; font-family: inherit; }

/* Helpers */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-right { text-align: right; }
.font-mono { font-family: Consolas, monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Official Receipt Styling */
.receipt-paper { padding: 20px; background: #fffdf5; border: 2px dashed #0284c7; border-radius: 8px; margin: 10px 0; color: #1e293b; }
.receipt-header-row { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #0284c7; padding-bottom: 12px; }
.receipt-header-row .sangha-logo { font-size: 42px; }
.receipt-header-row h2 { margin: 0; font-size: 22px; color: #0284c7; font-weight: 800; letter-spacing: 1px; }
.receipt-header-row p { font-size: 11px; color: #64748b; margin: 2px 0; }
.receipt-badge { width: fit-content; margin: 14px auto; background: #0284c7; color: white; padding: 4px 18px; border-radius: 20px; font-weight: 700; font-size: 12px; letter-spacing: 1px; }
.receipt-meta-row { display: flex; justify-content: space-between; font-size: 13px; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 14px; }
.receipt-body-text { font-size: 13px; line-height: 2; color: #334155; }
.amount-highlight { background: #dcfce7; color: #15803d; font-weight: 800; padding: 2px 12px; border-radius: 4px; font-size: 15px; border: 1px solid #86efac; }
.receipt-signatures { display: flex; justify-content: space-between; margin-top: 40px; position: relative; }
.sign-box { text-align: center; font-size: 11px; color: #475569; }
.sign-box .sig-line { width: 160px; height: 1px; background: #94a3b8; margin-bottom: 6px; }
.sign-box .club-seal { position: absolute; right: 20px; top: -30px; border: 2px solid #dc2626; color: #dc2626; font-weight: 800; font-size: 10px; padding: 2px 10px; border-radius: 4px; transform: rotate(-8deg); }

/* Notice Banner */
.notice-banner { background: #eff6ff; border-left: 4px solid var(--primary); padding: 12px 18px; border-radius: 6px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #1e40af; }
.notice-banner a { color: #1d4ed8; font-weight: 600; text-decoration: underline; }

@media (max-width: 900px) {
  .app-wrapper { flex-direction: column; }
  .sidebar { width: 100%; }
  .topbar { padding: 0 16px; }
  .content-area { padding: 16px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .page-header, .toolbar, .no-print, .actions, .modal-head, .modal-foot { display: none !important; }
  body, .app-wrapper, .main-wrapper, .content-area { background: white !important; padding: 0 !important; margin: 0 !important; }
  .printable, .receipt-paper { border: none !important; box-shadow: none !important; margin: 0 !important; }
  .modal-overlay { position: static !important; background: none !important; display: block !important; padding: 0 !important; }
  .modal-window { box-shadow: none !important; border: none !important; width: 100% !important; max-width: 100% !important; }
}
