/* ============================================================= */
/* QuincyVentures POS RestaurantHub Setup — Admin Theme           */
/* ============================================================= */

:root {
    --bg:         #0f1117;
    --surface:    #1a1d27;
    --surface2:   #242836;
    --border:     #2e3347;
    --text:       #e4e6f0;
    --muted:      #8b8fa3;
    --accent:     #6366f1;
    --accent-hover:#818cf8;
    --success:    #22c55e;
    --warning:    #f59e0b;
    --danger:     #ef4444;
    --info:       #3b82f6;
    --radius:     10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---------- Layout ---------- */
.setup-shell { display: flex; min-height: 100vh; }
.setup-sidebar { width: 260px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; z-index: 50; }
.setup-sidebar .brand { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.setup-sidebar .brand h2 { font-size: 16px; font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.setup-sidebar .brand small { color: var(--muted); font-size: 11px; }
.setup-sidebar nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.setup-sidebar nav a,
.setup-sidebar nav .nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; transition: all .15s; cursor: pointer; border: none; background: none; text-align: left; width: 100%; text-decoration: none; }
.setup-sidebar nav a:hover,
.setup-sidebar nav .nav-link:hover { background: var(--surface2); color: var(--text); }
.setup-sidebar nav a.active,
.setup-sidebar nav .nav-link.active { background: rgba(99,102,241,.15); color: var(--accent); }
.setup-sidebar .sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.setup-main { margin-left: 260px; flex: 1; padding: 32px 40px; max-width: 1200px; }

/* ---------- Header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header .subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card-header { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ---------- Stat cards ---------- */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card .stat-value { font-size: 32px; font-weight: 800; color: var(--accent); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-control { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; outline: none; transition: border .15s; }
.form-control:focus { border-color: var(--accent); }
select.form-control { appearance: none; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.chk-group { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.chk-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.chk-group label { margin: 0; text-transform: none; font-size: 14px; color: var(--text); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-active { background: rgba(34,197,94,.15); color: var(--success); }
.badge-inactive { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-plan { background: rgba(99,102,241,.15); color: var(--accent); }

/* ---------- Tabs ---------- */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tab-bar .tab-btn { padding: 12px 20px; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .15s; }
.tab-bar .tab-btn:hover { color: var(--text); }
.tab-bar .tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: var(--success); }
.alert-danger { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: var(--danger); }
.alert-info { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: var(--info); }

/* ---------- Login ---------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 48px 40px; width: 420px; max-width: 95vw; text-align: center; }
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-card .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 32px; }
.login-card .form-group { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }

/* ---------- Merchant row ---------- */
.merchant-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); transition: border-color .15s; cursor: pointer; }
.merchant-row:hover { border-color: var(--accent); }
.merchant-row .merch-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #fff; background: var(--accent); flex-shrink: 0; }
.merchant-row .merch-info { flex: 1; }
.merchant-row .merch-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.merchant-row .merch-info small { color: var(--muted); font-size: 12px; }
.merchant-row .merch-meta { display: flex; gap: 12px; align-items: center; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---------- Setup Modal ---------- */
.ms-modal-overlay { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); overflow-y: auto; padding: 40px 24px; }
.ms-modal-overlay.open { display: block; }
.ms-modal { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 960px; padding: 36px 40px; margin: 0 auto; animation: msModalIn .25s ease; }
.ms-modal-close { position: absolute; top: 14px; right: 16px; background: transparent; border: none; color: var(--muted); font-size: 28px; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px; transition: all .15s; z-index: 1; }
.ms-modal-close:hover { color: var(--text); background: var(--surface2); }
@keyframes msModalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .ms-modal { padding: 24px 20px; }
    .setup-sidebar { display: none; }
    .setup-main { margin-left: 0; padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .plan-cards-grid { grid-template-columns: 1fr; }
    .billing-cards-grid { grid-template-columns: 1fr; }
    .sub-summary-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Plan Cards ---------- */
.plan-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.plan-card { background: var(--bg); border: 2px solid var(--border); border-radius: 12px; padding: 24px; position: relative; transition: border-color .2s, transform .2s; }
.plan-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.plan-card-current { border-color: var(--accent); background: rgba(99,102,241,.04); }
.plan-current-badge { position: absolute; top: -10px; right: 16px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 10px; text-transform: uppercase; letter-spacing: .5px; }
.plan-card-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.plan-card-price { display: flex; align-items: baseline; gap: 2px; margin-bottom: 4px; }
.plan-dollar { font-size: 18px; font-weight: 600; color: var(--muted); }
.plan-amount { font-size: 36px; font-weight: 800; color: var(--accent); line-height: 1; }
.plan-period { font-size: 14px; color: var(--muted); margin-left: 2px; }
.plan-annual { font-size: 12px; color: var(--success); margin-bottom: 12px; }
.plan-limits { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.plan-features { list-style: none; padding: 0; margin: 0; }
.plan-features li { font-size: 13px; color: var(--text); padding: 4px 0; }
.plan-features li::before { content: none; }

/* ---------- Subscription Summary ---------- */
.sub-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sub-summary-item { display: flex; flex-direction: column; gap: 6px; }
.sub-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- Billing Cards ---------- */
.billing-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.billing-card { background: linear-gradient(135deg, #1e2235 0%, #161929 100%); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.billing-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(99,102,241,.08); }
.billing-card-default { border-color: var(--accent); }
.billing-card-expired { opacity: .6; }
.billing-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.billing-card-brand { font-size: 14px; font-weight: 700; color: var(--accent); }
.billing-card-number { font-size: 18px; font-weight: 600; letter-spacing: 2px; color: var(--text); margin-bottom: 16px; }
.billing-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.billing-card-holder { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.billing-card-exp { font-size: 13px; color: var(--muted); }

/* ---------- Billing Dashboard ---------- */
.billing-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; }
.metric-card .metric-icon { font-size: 28px; width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(99,102,241,.1); flex-shrink: 0; }
.metric-card .metric-body { flex: 1; }
.metric-card .metric-value { font-size: 24px; font-weight: 800; color: var(--text); }
.metric-card .metric-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.metric-highlight { border-color: var(--accent); background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, var(--surface) 100%); }
.metric-highlight .metric-value { color: var(--accent); }
.metric-highlight .metric-icon { background: rgba(99,102,241,.18); }

.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stats-row .stat-card { text-align: center; }
.stats-row .stat-value.accent { color: var(--accent); }
.stats-row .stat-value.muted { color: var(--muted); }
.stats-row .stat-value.success { color: var(--success); }
.stats-row .stat-value.warning { color: var(--warning); }
.stats-row .stat-value.danger { color: var(--danger); }

.breakdown-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.breakdown-grid { display: flex; flex-direction: column; gap: 12px; }
.breakdown-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.breakdown-bar { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.breakdown-bar.starter { background: var(--info); }
.breakdown-bar.pro { background: var(--accent); }
.breakdown-bar.enterprise { background: var(--warning); }
.breakdown-bar.mh-basic { background: #22d3ee; }
.breakdown-bar.mh-growth { background: #a78bfa; }
.breakdown-bar.mh-premium { background: #f472b6; }
.breakdown-bar.mh-none { background: var(--border); }
.breakdown-info { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.breakdown-plan { font-size: 14px; font-weight: 600; }
.breakdown-price { font-size: 12px; color: var(--muted); }
.breakdown-count { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }

.mh-upsell { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 12px 16px; background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.2); border-radius: 8px; font-size: 13px; color: var(--warning); }

.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-mh-none { background: rgba(255,255,255,.06); color: var(--muted); }

@media (max-width: 1100px) {
    .billing-metrics { grid-template-columns: repeat(2, 1fr); }
    .breakdown-row { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .stats-row { grid-template-columns: repeat(3, 1fr); }
    .billing-metrics { grid-template-columns: 1fr; }
}
