/* ACBIZ CORE v1 - Base Stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #1a56db;
    --primary-h: #1648c0;
    --dark:      #111827;
    --gray:      #6b7280;
    --light:     #f9fafb;
    --border:    #e5e7eb;
    --radius:    8px;
    --shadow:    0 1px 3px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 20px; font-weight: 700; color: var(--primary); text-decoration: none; letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--gray); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--primary); }

/* Main */
main.container { padding-top: 40px; padding-bottom: 60px; min-height: calc(100vh - 130px); }

/* Hero */
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 16px; }
.hero p  { font-size: 18px; color: var(--gray); margin-bottom: 32px; }
.btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 60px; }
.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p  { color: var(--gray); font-size: 14px; }

/* Buttons */
.btn { display: inline-block; padding: 10px 24px; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: background .2s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-outline  { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-full { width: 100%; text-align: center; }

/* Auth Card */
.auth-card { max-width: 420px; margin: 40px auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 24px; margin-bottom: 28px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; transition: border-color .2s; }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
.auth-footer { margin-top: 20px; text-align: center; font-size: 14px; color: var(--gray); }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* Footer */
.footer { background: #fff; border-top: 1px solid var(--border); padding: 20px 0; text-align: center; font-size: 13px; color: var(--gray); }

/* ── Payment / Lenco Styles ─────────────────────────────────── */
.pay-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; max-width: 900px; margin: 0 auto; }
@media (max-width: 700px) { .pay-wrap { grid-template-columns: 1fr; } }

.pay-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.pay-card h2 { font-size: 22px; margin-bottom: 4px; }
.pay-sub { color: var(--gray); font-size: 14px; margin-bottom: 28px; }
.pay-secure { text-align: center; font-size: 12px; color: var(--gray); margin-top: 16px; }

.input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.input-prefix .prefix { background: #f3f4f6; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--gray); border-right: 1px solid var(--border); white-space: nowrap; }
.input-prefix input { border: none; border-radius: 0; flex: 1; }
.input-prefix input:focus { box-shadow: none; border-color: transparent; }

.channel-select { display: flex; gap: 16px; }
.channel-opt { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #f9fafb; }
.channel-opt input { margin: 0; }

.pay-sidebar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.pay-sidebar h4 { font-size: 15px; margin-bottom: 14px; }

.sandbox-note { background: #fff8e1; border: 1px solid #ffe082; border-radius: 6px; padding: 12px; font-size: 13px; color: #5d4037; margin-top: 16px; }
.sandbox-note code { background: #fff3cd; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Table */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: #f9fafb; padding: 12px 16px; text-align: left; font-weight: 600; font-size: 13px; color: var(--gray); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; }
.data-table tr:last-child td { border-bottom: none; }
.data-table code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-successful { background: #d1fae5; color: #065f46; }
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-failed     { background: #fee2e2; color: #991b1b; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state p { font-size: 18px; margin-bottom: 20px; }

/* ── Client CRM Styles ──────────────────────────────────── */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    align-items: center;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.client-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}

.client-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.client-avatar {
    width: 44px; height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800;
    margin-bottom: 12px;
}

.client-header-avatar {
    width: 48px; height: 48px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800;
    flex-shrink: 0;
}

.client-name    { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.client-company { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.client-email   { font-size: 13px; color: #64748b; margin-bottom: 2px; }
.client-phone   { font-size: 13px; color: #64748b; }
.client-info    { margin-bottom: 14px; }

.client-stats {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.cstat         { flex: 1; text-align: center; }
.cstat-val     { display: block; font-size: 15px; font-weight: 700; color: #0f172a; }
.cstat-label   { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }

.client-actions { display: flex; gap: 8px; }

/* Client autocomplete dropdown */
.client-dropdown {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
}

.client-dd-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
    line-height: 1.5;
}

.client-dd-item:last-child { border-bottom: none; }
.client-dd-item:hover { background: #eff6ff; }

/* ── Reports & Analytics ────────────────────────────────── */
.comparison-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
    text-align: center;
}
.comp-item  { flex: 1; }
.comp-label { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.comp-value { font-size: 24px; font-weight: 800; color: #0f172a; }
.comp-count { font-size: 12px; color: #64748b; margin-top: 4px; }
.comp-arrow { font-size: 20px; font-weight: 800; padding: 10px 16px; border-radius: 8px; }
.arrow-up   { color: #059669; background: #d1fae5; }
.arrow-down { color: #dc2626; background: #fee2e2; }

.today-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.today-item  { text-align: center; padding: 16px; background: #f8fafc; border-radius: 8px; }
.today-val   { font-size: 22px; font-weight: 800; color: #0f172a; }
.today-label { font-size: 12px; color: #64748b; margin-top: 4px; }

.client-bar-row   { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.client-bar-rank  { width: 24px; height: 24px; background: #0f172a; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.client-bar-track { height: 6px; background: #f1f5f9; border-radius: 3px; overflow: hidden; }
.client-bar-fill  { height: 100%; background: linear-gradient(90deg,#1a56db,#3b82f6); border-radius: 3px; transition: width .6s ease; }

.status-legend { flex: 1; }

.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width:700px) { .export-grid { grid-template-columns: 1fr; } }
.export-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; }
.export-item h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.export-item p  { font-size: 13px; color: #64748b; }

/* ── Subscription Plans ─────────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 20px; }

.plan-card { background:#fff; border:1px solid var(--border); border-radius:12px; padding:22px; box-shadow:0 1px 3px rgba(0,0,0,.06); transition:box-shadow .2s; }
.plan-card:hover { box-shadow:0 4px 12px rgba(0,0,0,.1); }
.plan-inactive { opacity:.6; }

.plan-card-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:14px; gap:10px; }
.plan-name  { font-size:17px; font-weight:700; color:#0f172a; }
.plan-desc  { font-size:13px; color:#64748b; margin-top:3px; }

.plan-price { margin-bottom:10px; }
.plan-amount   { font-size:26px; font-weight:800; color:#0f172a; }
.plan-interval { font-size:14px; color:#64748b; }

.plan-trial { font-size:13px; color:#059669; font-weight:600; margin-bottom:12px; }

.plan-stats { display:flex; gap:12px; padding:12px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); margin-bottom:14px; }
.pstat      { flex:1; text-align:center; }
.pstat-val  { display:block; font-size:16px; font-weight:700; color:#0f172a; }
.pstat-label{ display:block; font-size:11px; color:#94a3b8; margin-top:2px; }

.plan-actions { display:flex; gap:8px; }

/* Plan picker in create form */
.plan-picker { display:flex; flex-direction:column; gap:10px; }
.plan-pick-opt { display:flex; align-items:center; gap:14px; padding:14px 16px; border:2px solid var(--border); border-radius:10px; cursor:pointer; transition:border-color .15s, background .15s; }
.plan-pick-opt:hover   { border-color:var(--primary); background:#f8fafc; }
.plan-pick-opt.selected{ border-color:var(--primary); background:#eff6ff; }
.plan-pick-opt input   { flex-shrink:0; }
.plan-pick-name  { font-size:15px; font-weight:700; color:#0f172a; }
.plan-pick-price { font-size:13px; color:#64748b; margin-top:2px; }
.plan-pick-trial { font-size:12px; color:#059669; font-weight:600; margin-top:2px; }

/* Plan summary box */
.plan-summary { background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; padding:14px 16px; margin-bottom:20px; }
.plan-summary-row { display:flex; justify-content:space-between; font-size:14px; padding:4px 0; color:#334155; }

/* ── API Keys & Developer ───────────────────────────────── */
.api-key-reveal {
    background: #0f172a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #1e40af;
}
.api-key-reveal-header {
    font-size: 14px;
    font-weight: 600;
    color: #93c5fd;
    margin-bottom: 12px;
}
.api-key-reveal-body {
    display: flex;
    gap: 10px;
    align-items: center;
}
.api-key-input {
    flex: 1;
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-family: monospace;
    font-size: 13px;
}
.api-key-warn {
    font-size: 12px;
    color: #f59e0b;
    margin-top: 10px;
}

.scope-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.scope-opt {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    background: #f9fafb;
    transition: border-color .15s;
}
.scope-opt:hover { border-color: var(--primary); }
.scope-opt input { margin-top: 2px; flex-shrink: 0; }
.scope-opt small { color: #94a3b8; display: block; margin-top: 2px; }

.scope-tag {
    display: inline-block;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    margin: 1px;
}

.endpoint-list { display: flex; flex-direction: column; gap: 6px; }
.endpoint-row  { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.endpoint-method {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    min-width: 36px;
    text-align: center;
}
.method-get  { background: #d1fae5; color: #065f46; }
.method-post { background: #dbeafe; color: #1e40af; }
.method-put  { background: #fef3c7; color: #92400e; }
.method-delete { background: #fee2e2; color: #991b1b; }
.endpoint-path { font-family: monospace; font-size: 12px; color: #475569; }
.endpoint-desc { color: #94a3b8; font-size: 11px; }

/* ── Notification Center ────────────────────────────────── */
.notif-bell-wrap {
    position: relative;
}

.notif-bell-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    position: relative;
    transition: background .15s;
    line-height: 1;
}

.notif-bell-btn:hover { background: #f1f5f9; }

.notif-bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #fff;
}

/* Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    z-index: 300;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.notif-dropdown-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

.notif-dropdown-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

.notif-dropdown-empty {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

.notif-dd-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f8fafc;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.notif-dd-item:hover { background: #f8fafc; }
.notif-dd-item:last-child { border-bottom: none; }

.notif-dd-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.notif-dd-title { font-size: 13px; font-weight: 600; color: #0f172a; margin-bottom: 2px; }
.notif-dd-msg   { font-size: 12px; color: #64748b; }

/* Nav badge */
.nav-notif-badge {
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    margin-left: 4px;
}

/* ── Notification Page ──────────────────────────────────── */
.notif-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    padding: 0 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.notif-list { display: flex; flex-direction: column; gap: 8px; }

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: box-shadow .15s;
}

.notif-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.notif-unread {
    border-left: 4px solid var(--primary);
    background: #fafcff;
}

.notif-read { opacity: .75; }

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notif-color-green  { background: #d1fae5; }
.notif-color-red    { background: #fee2e2; }
.notif-color-orange { background: #fef3c7; }
.notif-color-blue   { background: #dbeafe; }

.notif-body { flex: 1; min-width: 0; }
.notif-title   { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.notif-message { font-size: 13px; color: #475569; margin-bottom: 4px; }
.notif-time    { font-size: 11px; color: #94a3b8; }

.notif-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }

@media (max-width: 600px) {
    .notif-item    { flex-wrap: wrap; }
    .notif-actions { width: 100%; justify-content: flex-end; }
    .notif-dropdown { width: 280px; right: -40px; }
}

/* ── Gateway Selector ───────────────────────────────────── */
.gateway-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.gateway-opt {
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #f9fafb;
    transition: border-color .15s, background .15s, box-shadow .15s;
    overflow: hidden;
}

.gateway-opt:hover {
    border-color: var(--primary);
    background: #f0f7ff;
}

.gateway-opt.selected {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}

.gateway-opt input[type="radio"] { display: none; }

.gateway-opt-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;
    text-align: center;
}

.gateway-icon { font-size: 24px; }
.gateway-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.gateway-tag  { font-size: 10px; color: #94a3b8; font-weight: 500; }

.gateway-opt.selected .gateway-name { color: var(--primary); }

@media (max-width: 500px) {
    .gateway-grid { grid-template-columns: repeat(2, 1fr); }
}
