/**
 * style.css  —  Global Application Stylesheet
 * Pairs with Bootstrap 5.3.2
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ══ CSS Variables ══════════════════════════════════════════════════════════ */
:root {
    /* Brand */
    --accent:           #f59e0b;
    --accent-dark:      #d97706;
    --accent-light:     #fef3c7;
    --accent-glow:      rgba(245,158,11,.18);

    /* Surfaces */
    --surface-1:        #ffffff;
    --surface-2:        #f9fafb;
    --surface-3:        #f3f4f6;

    /* Text */
    --text-base:        #111827;
    --text-muted:       #6b7280;
    --text-light:       #9ca3af;

    /* Borders */
    --border:           #e5e7eb;
    --border-dark:      #d1d5db;

    /* Status */
    --success:          #10b981;
    --danger:           #ef4444;
    --warning:          #f59e0b;
    --info:             #3b82f6;

    /* Layout */
    --navbar-h:         62px;
    --sidebar-w:        240px;
    --radius:           10px;
    --radius-lg:        16px;
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:        0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:        0 10px 40px rgba(0,0,0,.12);

    /* Typography */
    --font:             'Plus Jakarta Sans', system-ui, sans-serif;
    --mono:             'JetBrains Mono', 'Courier New', monospace;
}

/* ══ Base ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 14.5px;
    color: var(--text-base);
    background: var(--surface-2);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

/* ══ Navbar ═════════════════════════════════════════════════════════════════ */
.app-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    height: var(--navbar-h);
    padding: 0;
}

.app-navbar .navbar-brand { font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--text-base); }
.app-navbar .navbar-brand:hover { color: var(--accent); }

.brand-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: #fff; font-size: 15px;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.app-navbar .nav-link {
    font-weight: 600; font-size: 13.5px;
    color: var(--text-muted);
    padding: 6px 12px; border-radius: 8px;
    transition: color .18s, background .18s;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: var(--text-base);
    background: var(--surface-3);
}

/* ══ Footer ═════════════════════════════════════════════════════════════════ */
.app-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.footer-brand { color: var(--text-base); font-size: 15px; font-weight: 700; }
.brand-icon-sm {
    width: 26px; height: 26px; border-radius: 6px; font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), #fb923c); color: #fff;
}

.footer-copy { color: var(--text-light); font-size: 12px; }

.footer-social a {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--surface-3); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.footer-social a:hover { color: var(--accent); background: var(--accent-light); border-color: var(--accent); transform: translateY(-2px); }

.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 12.5px; font-weight: 500; transition: color .18s; }
.footer-links a:hover { color: var(--accent); }

/* ══ Cards ══════════════════════════════════════════════════════════════════ */
.app-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.app-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700; font-size: 15px;
}
.app-card-body { padding: 20px; }

/* stat cards */
.stat-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 14px;
}
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.stat-badge { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 7px; }

/* ══ Buttons — custom overrides ═════════════════════════════════════════════ */
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: #fff; font-weight: 700;
    border: none; border-radius: var(--radius);
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: opacity .2s, transform .15s, box-shadow .2s;
}
.btn-accent:hover  { color: #fff; opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,.35); }
.btn-accent:active { transform: translateY(0); }
.btn-accent:disabled { opacity: .6; }

/* ══ Badges ══════════════════════════════════════════════════════════════════ */
.badge-dot {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600;
    padding: 3px 9px; border-radius: 100px;
}
.badge-dot::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; opacity: .7;
}

/* ══ Tables ══════════════════════════════════════════════════════════════════ */
.table-app {
    font-size: 13.5px; border-collapse: separate; border-spacing: 0;
}
.table-app thead th {
    background: var(--surface-3); color: var(--text-muted);
    font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: .07em;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table-app tbody td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table-app tbody tr:last-child td { border-bottom: none; }
.table-app tbody tr:hover { background: rgba(245,158,11,.035); }

/* DataTables integration */
table.dataTable.table-app { border-radius: var(--radius-lg); overflow: hidden; }
.dataTables_wrapper .dataTables_filter input { border-radius: var(--radius); border: 1.5px solid var(--border); padding: 5px 12px; }
.dataTables_wrapper .dataTables_length select { border-radius: var(--radius); border: 1.5px solid var(--border); }

/* ══ Alerts / Response areas ════════════════════════════════════════════════ */
.response-area .alert {
    border-radius: var(--radius);
    font-size: 13.5px;
    display: flex; align-items: flex-start; gap: 8px;
}

/* ══ Toast container ════════════════════════════════════════════════════════ */
#toastContainer .toast {
    min-width: 300px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: 13.5px;
}

/* ══ Spinner (legacy .twoToneButton support) ════════════════════════════════ */
.twoToneButton.spinning {
    pointer-events: none; opacity: .75; position: relative;
}
.twoToneButton.spinning::after {
    content: '';
    position: absolute; right: 12px; top: 50%; margin-top: -8px;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ Forms — global tweaks ══════════════════════════════════════════════════ */
.form-control, .form-select {
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-base);
    transition: border-color .18s, box-shadow .18s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-label {
    font-size: 12px; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 6px;
}

/* ══ Modals ══════════════════════════════════════════════════════════════════ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}
.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px 20px;
}

/* ══ Utilities ═══════════════════════════════════════════════════════════════ */
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.text-accent { color: var(--accent) !important; }
.bg-accent-soft { background: var(--accent-light) !important; }
.border-accent { border-color: var(--accent) !important; }
.rounded-app { border-radius: var(--radius) !important; }
.rounded-app-lg { border-radius: var(--radius-lg) !important; }
.shadow-app { box-shadow: var(--shadow-md) !important; }
.font-mono { font-family: var(--mono) !important; }
.cursor-pointer { cursor: pointer; }

/* ══ Responsive tweaks ═══════════════════════════════════════════════════════ */
@media (max-width: 576px) {
    .stat-value { font-size: 20px; }
    .app-card-body { padding: 14px; }
    .modal-content { border-radius: 12px 12px 0 0; }
}
