/* Axcap247 Market Price Update Portal */
:root {
    --bg: #0f172a;
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --danger: #b91c1c;
    --danger-dark: #991b1b;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
    --info-bg: #dbeafe;
    --info-text: #1e40af;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-soft);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 1534px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--bg); color: #e2e8f0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: #fff; font-size: 12px; font-weight: 800;
    letter-spacing: .04em; padding: 6px 8px; border-radius: 8px;
}
.brand-text { font-size: 15px; }
.main-nav { display: flex; gap: 6px; margin-left: auto; }
.main-nav a { color: #cbd5e1; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.main-nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; color: #fff; }
.main-nav a.is-active { background: var(--primary); color: #fff; }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-name { color: #94a3b8; font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.content { padding: 28px 20px 48px; }
.site-footer { border-top: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 13px; }
.site-footer .wrap { padding-top: 16px; padding-bottom: 16px; }

/* Panel */
.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
}
.panel-head { margin-bottom: 20px; }
.panel-head h1 { margin: 0 0 4px; font-size: 20px; }
.panel-sub { margin: 0; color: var(--text-muted); font-size: 13.5px; }

/* Flash */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.flash { padding: 12px 14px; border-radius: 8px; font-size: 14px; border: 1px solid transparent; }
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }
.flash-warning { background: var(--warning-bg); color: var(--warning-text); }
.flash-info { background: var(--info-bg); color: var(--info-text); }

/* Forms */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"] {
    width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid rgba(29, 78, 216, .35); border-color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; font-size: 14px; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn.is-disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.inline-form { display: inline; margin: 0; }

/* Auth */
.auth-card {
    max-width: 420px; margin: 40px auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 32px;
}
.auth-title { margin: 0 0 2px; font-size: 22px; }
.auth-subtitle { margin: 0 0 24px; color: var(--text-muted); font-size: 14px; }


/* Stock picker */
.stock-picker { position: relative; }
.picker-input { position: relative; }
.picker-spinner {
    position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
    border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stock-results {
    list-style: none; margin: 6px 0 0; padding: 4px; max-height: 280px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    box-shadow: var(--shadow); position: absolute; z-index: 20; width: 100%;
}
.stock-results li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.stock-results li:hover, .stock-results li.is-active { background: var(--bg-soft); }
.result-main { display: flex; gap: 8px; align-items: baseline; }
.result-ticker { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.result-name { color: var(--text); }
.result-sub { font-size: 12px; color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.result-more { padding: 8px 10px; font-size: 12px; color: var(--text-muted); text-align: center; }

.picker-status { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); min-height: 16px; }
.picker-status.is-error { color: var(--error-text); }

.stock-selected { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); padding: 12px 14px; }
.stock-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 0; }
.stock-meta div { display: flex; flex-direction: column; }
.stock-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.stock-meta dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { background: var(--bg-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .num { text-align: right; }
.data-table .mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.actions-col { text-align: right; }
.empty-state { color: var(--text-muted); padding: 24px 0; text-align: center; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 16px; }
.pagination-summary { font-size: 13px; color: var(--text-muted); }
.pagination-links { display: flex; gap: 6px; }

@media (max-width: 720px) {
    .header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
    .main-nav { order: 3; width: 100%; margin-left: 0; }
    .user-box { margin-left: auto; }
    .content { padding: 18px 16px 40px; }
    .panel { padding: 18px; }
}

/* ==========================================================================
   Admin panel shell — left sidebar is the primary navigation
   ========================================================================== */
.admin-shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
    flex: 0 0 252px;
    width: 252px;
    background: var(--bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar .brand { flex: 1; min-width: 0; }
.sidebar .brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-title { font-size: 14px; font-weight: 700; color: #fff; }
.brand-sub {
    font-size: 10.5px; font-weight: 600; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .07em;
}
.sidebar-close {
    display: none; background: transparent; border: 0; color: #cbd5e1;
    font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.sidebar-close:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; flex: 1 0 auto; }
.side-link {
    display: block; padding: 10px 12px; border-radius: 8px;
    color: #cbd5e1; font-weight: 500; font-size: 14px;
}
.side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.side-link.is-active { background: var(--primary); color: #fff; }

.sidebar-user {
    padding: 16px 18px; border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex; flex-direction: column; gap: 6px;
}
.sidebar-user-label {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8;
}
.sidebar-user-name {
    font-size: 14px; font-weight: 600; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .btn-ghost {
    background: transparent; border-color: rgba(255, 255, 255, .2); color: #e2e8f0;
}
.sidebar-user .btn-ghost:hover { background: rgba(255, 255, 255, .08); }

.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--bg-soft); }
.admin-main .content { flex: 1 0 auto; }

.topbar {
    display: flex; align-items: center; gap: 16px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 12px 24px;
}
.topbar-title { font-weight: 700; font-size: 15px; color: var(--text); }
.topbar-user { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.sidebar-toggle {
    display: none; background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 12px; font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.sidebar-toggle:hover { background: var(--bg-soft); }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 40; }

@media (max-width: 900px) {
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100vh;
        z-index: 50; transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .35);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-close { display: inline-block; }
    .sidebar-toggle { display: inline-flex; align-items: center; gap: 6px; }
    .topbar { padding: 10px 16px; }
    .topbar-user { display: none; }
}

/* Dashboard */
.stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 4px;
}
.stat-card {
    border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px;
    background: var(--bg-soft); display: flex; flex-direction: column; gap: 4px;
}
.stat-label {
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted); font-weight: 700;
}
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.15; color: var(--text); }
.stat-hint { font-size: 12px; color: var(--text-muted); }
.panel-head h2 { margin: 0 0 4px; font-size: 17px; }
.panel-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 16px; flex-wrap: wrap;
}
.muted { color: var(--text-muted); }

