/* ============================================================
   style.css — Cowave Global Payment Gateway
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.10);
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
       background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout helpers ─────────────────────────────────── */
.page-center { display: flex; flex-direction: column; align-items: center;
               justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
.container { width: 100%; max-width: 480px; }
.container-md { width: 100%; max-width: 780px; }
.container-lg { width: 100%; max-width: 960px; }

/* ─── Card ───────────────────────────────────────────── */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
        box-shadow: var(--shadow); padding: 2rem; }
.card-sm { padding: 1.25rem; }

/* ─── Logo / Header ─────────────────────────────────── */
.logo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
        box-shadow: 0 4px 16px rgba(37,99,235,.20); display: block; margin: 0 auto 1.25rem; }
.logo-sm { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.page-title { font-size: 2rem; font-weight: 800; text-align: center; letter-spacing: -.02em; }
.page-sub { color: var(--muted); text-align: center; margin-top: .4rem; font-size: .9rem; display: flex; align-items: center; justify-content: center; gap: .4rem; }

/* ─── Amount box ─────────────────────────────────────── */
.amount-hero { text-align: center; margin-bottom: 1.5rem; }
.amount-hero .label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.amount-hero .amount { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; color: var(--text); }
.breakdown { background: #f1f5f9; border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; }
.breakdown-row { display: flex; justify-content: space-between; align-items: center;
                 font-size: .875rem; padding: .3rem 0; color: var(--muted); }
.breakdown-row.total { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .75rem;
                       font-size: 1rem; font-weight: 700; color: var(--primary); }
.breakdown-row.total .label { color: var(--text); }

/* ─── QR ─────────────────────────────────────────────── */
.qr-wrap { display: flex; flex-direction: column; align-items: center; margin: 1.5rem 0; }
.qr-wrap img, .qr-wrap canvas { border-radius: 12px; border: 1px solid var(--border);
                                  padding: 12px; background: #fff; }
.qr-caption { font-size: .8rem; color: var(--muted); margin-top: .75rem; }

/* ─── UPI Buttons ────────────────────────────────────── */
.upi-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.upi-btn { display: flex; flex-direction: column; align-items: center; gap: .5rem;
           padding: .875rem .5rem; border-radius: 14px; border: 1px solid var(--border);
           background: #f8fafc; font-size: .75rem; font-weight: 600; color: var(--text);
           cursor: pointer; transition: all .15s; text-decoration: none; }
.upi-btn:hover { background: var(--primary-light); border-color: var(--primary);
                 color: var(--primary); text-decoration: none; transform: translateY(-2px); }
.upi-btn .icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
                 justify-content: center; font-weight: 800; font-size: .7rem; color: #fff; }
.icon-gpay  { background: #4285F4; }
.icon-phone { background: #5f259f; }
.icon-paytm { background: #00b9f1; }

/* ─── Note box ───────────────────────────────────────── */
.note-box { background: var(--primary-light); border: 1px solid #bfdbfe; border-radius: 12px;
            padding: 1rem; margin-bottom: 1.25rem; font-size: .875rem; color: var(--primary);
            font-weight: 500; text-align: center; }

/* ─── Buttons ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
       font-size: .9rem; font-weight: 600; padding: .875rem 1.5rem; border-radius: 12px;
       border: none; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.30); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); text-decoration: none; color:#fff; }
.btn-primary:active { transform: translateY(0); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; color:#fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; text-decoration: none; color:#fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn-sm { padding: .45rem .9rem; font-size: .8rem; border-radius: 8px; }
.btn-full { width: 100%; }

/* ─── Form ───────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .45rem; color: var(--text); }
.form-control { width: 100%; padding: .8rem 1rem; border: 1.5px solid var(--border); border-radius: 12px;
                font-size: .95rem; outline: none; transition: border .15s; background: #fff; color: var(--text); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.form-error { color: var(--danger); font-size: .78rem; margin-top: .3rem; }
.form-hint { color: var(--muted); font-size: .78rem; margin-top: .3rem; }
.required-badge { background: #fee2e2; color: var(--danger); font-size: .7rem; font-weight: 700;
                  padding: .1rem .4rem; border-radius: 6px; margin-left: .4rem; }

/* ─── Alerts ─────────────────────────────────────────── */
.alert { padding: .875rem 1rem; border-radius: 12px; font-size: .875rem; font-weight: 500; margin-bottom: 1rem; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: var(--warning); }

/* ─── Verify page ────────────────────────────────────── */
.timer-ring { width: 140px; height: 140px; margin: 1.5rem auto; position: relative; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .bg { fill: none; stroke: #e2e8f0; stroke-width: 8; }
.timer-ring .prog { fill: none; stroke: var(--primary); stroke-width: 8;
                    stroke-linecap: round; stroke-dasharray: 408; stroke-dashoffset: 0;
                    transition: stroke-dashoffset 1s linear; }
.timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
              font-size: 1.7rem; font-weight: 800; color: var(--text); }
.verify-msg { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border);
           border-top-color: var(--primary); border-radius: 50%;
           animation: spin 1s linear infinite; margin: 1rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Admin ──────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--card); border-right: 1px solid var(--border);
           display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--border);
                  display: flex; align-items: center; gap: .75rem; }
.sidebar-title { font-weight: 800; font-size: 1rem; }
.sidebar-nav { padding: 1rem; flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.nav-link { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-radius: 10px;
            color: var(--muted); font-size: .875rem; font-weight: 500; transition: all .15s; }
.nav-link:hover, .nav-link.active { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }
.admin-main { flex: 1; padding: 2rem; overflow-y: auto; }
.admin-content { max-width: 900px; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 800; }
.page-header p { color: var(--muted); font-size: .875rem; margin-top: .25rem; }

/* ─── Tabs ───────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; background: #f1f5f9; border-radius: 12px;
        padding: .3rem; margin-bottom: 1.5rem; }
.tab { flex: 1; text-align: center; padding: .6rem; border-radius: 8px; font-size: .85rem;
       font-weight: 600; cursor: pointer; color: var(--muted); text-decoration: none; transition: all .15s; }
.tab.active, .tab:hover { background: #fff; color: var(--primary); text-decoration: none;
                           box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ─── Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border);
              background: var(--card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; padding: .875rem 1rem; font-size: .75rem; font-weight: 700;
     text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
     background: #f8fafc; border-bottom: 1px solid var(--border); }
td { padding: .875rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.td-actions { display: flex; gap: .5rem; }
.badge { display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 99px;
         font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #b91c1c; }

.empty-state { text-align: center; padding: 3rem 2rem; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; stroke: var(--border); margin-bottom: 1rem; }

/* ─── Invoice ────────────────────────────────────────── */
.invoice-page { background: #f1f5f9; min-height: 100vh; padding: 2rem 1rem; }
.invoice-actions { max-width: 210mm; margin: 0 auto 1.25rem; display: flex; justify-content: space-between; }
.invoice-wrap { width: 100%; max-width: 210mm; margin: 0 auto; background: #fff;
                border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg);
                padding: 40px 48px; min-height: 297mm; }
.inv-header { display: flex; justify-content: space-between; align-items: flex-start;
              padding-bottom: 1.5rem; border-bottom: 2px solid #f1f5f9; margin-bottom: 1.5rem; }
.inv-logo-row { display: flex; align-items: center; gap: 1rem; }
.inv-logo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.inv-company { font-size: 1.3rem; font-weight: 800; }
.inv-addr { font-size: .75rem; color: var(--muted); max-width: 220px; margin-top: .25rem; }
.inv-right { text-align: right; }
.inv-title { font-size: 2rem; font-weight: 900; color: #e2e8f0; letter-spacing: .1em; text-transform: uppercase; }
.inv-meta { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.inv-meta strong { color: var(--text); }
.inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.inv-section-title { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase;
                     letter-spacing: .08em; margin-bottom: .6rem; }
.inv-val { font-size: 1.1rem; font-weight: 700; }
.inv-sub { font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.inv-table th { font-size: .72rem; font-weight: 700; text-transform: uppercase;
                letter-spacing: .05em; color: var(--muted); padding: .75rem 1rem;
                background: #f8fafc; border-top: 2px solid #f1f5f9; border-bottom: 2px solid #f1f5f9; }
.inv-table td { padding: 1.25rem 1rem; border-bottom: 1px solid #f1f5f9; font-size: .9rem; }
.inv-totals { margin-left: auto; width: 280px; }
.inv-totals-row { display: flex; justify-content: space-between; padding: .4rem 0;
                  font-size: .875rem; color: var(--muted); }
.inv-totals-row.grand { border-top: 2px solid #f1f5f9; margin-top: .5rem; padding-top: .875rem;
                        font-weight: 800; font-size: 1.1rem; color: var(--primary); }
.inv-totals-row.grand .lbl { color: var(--text); }
.status-paid { color: var(--success); font-weight: 700; font-size: .8rem; text-transform: uppercase; }
.inv-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #f1f5f9;
              font-size: .75rem; color: var(--muted); text-align: center; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .upi-buttons { grid-template-columns: repeat(3, 1fr); }
  .inv-grid { grid-template-columns: 1fr; gap: 1rem; }
  .invoice-wrap { padding: 24px 20px; }
}

/* ─── Print ──────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .invoice-actions, .sidebar, .no-print { display: none !important; }
  .invoice-page { background: #fff; padding: 0; }
  .invoice-wrap { box-shadow: none; border-radius: 0; max-width: 100%; }
  .inv-header { -webkit-print-color-adjust: exact; }
}
