/* ==========================================================================
   FlexiNet - Shared Theme (Modern Minimal)
   Single source of visual truth for the dashboard shell and auth pages.
   Do not duplicate these rules in page-level <style> blocks.
   ========================================================================== */

:root {
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --accent-darker: #3730a3;
    --accent-light: #eef2ff;
    --accent-soft: #e0e7ff;

    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-alt: #f4f5fa;

    --text: #1f2333;
    --text-muted: #6b7280;
    --text-faint: #9ca3af;

    --border: #e8e9f1;
    --border-strong: #dcdde8;

    --sidebar-bg: #171a2b;
    --sidebar-bg-alt: #1f2338;
    --sidebar-text: #a6a9c1;
    --sidebar-text-hover: #ffffff;

    --success: #16a34a;
    --success-bg: #ecfdf3;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --info: #0891b2;
    --info-bg: #ecfeff;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --radius-pill: 50px;

    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06);
    --shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 20px 45px rgba(24, 24, 60, 0.16);
}

/* ---------------------------------------------------
   BASE
----------------------------------------------------- */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4, h5, h6 { font-family: 'Inter', sans-serif; color: var(--text); }

::selection { background: var(--accent-soft); }

/* ---------------------------------------------------
   BOOTSTRAP COLOR OVERRIDES (accent everywhere)
----------------------------------------------------- */
.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
}
.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-dark {
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline-dark:hover {
    background-color: var(--text);
    border-color: var(--text);
}
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-sm { border-radius: 8px; }
.rounded-pill.btn { border-radius: var(--radius-pill) !important; }

.text-primary { color: var(--accent) !important; }
.bg-primary { background-color: var(--accent) !important; }
.border-primary { border-color: var(--accent) !important; }

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem var(--accent-light);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.page-link { color: var(--accent); }
.page-item.active .page-link { background-color: var(--accent); border-color: var(--accent); }

.spinner-border.text-primary { color: var(--accent) !important; }

/* ---------------------------------------------------
   CARDS, TABLES, BADGES, ALERTS
----------------------------------------------------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.table { color: var(--text); }
.table thead th {
    background-color: var(--surface-alt);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}
.table-hover tbody tr:hover { background-color: var(--accent-light); }

.badge { font-weight: 600; border-radius: 6px; }
.badge.bg-success { background-color: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-danger { background-color: var(--danger-bg) !important; color: var(--danger) !important; }
.badge.bg-warning { background-color: var(--warning-bg) !important; color: var(--warning) !important; }
.badge.bg-info { background-color: var(--info-bg) !important; color: var(--info) !important; }

.alert { border: none; border-radius: var(--radius-sm); }
.alert-success { background-color: var(--success-bg); color: var(--success); }
.alert-danger { background-color: var(--danger-bg); color: var(--danger); }
.alert-warning { background-color: var(--warning-bg); color: var(--warning); }
.alert-info { background-color: var(--info-bg); color: var(--info); }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }

/* ---------------------------------------------------
   DASHBOARD SHELL: SIDEBAR
----------------------------------------------------- */
#wrapper { display: flex; width: 100%; align-items: stretch; }

#sidebar-wrapper {
    min-width: 17rem;
    max-width: 17rem;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: #fff;
    transition: margin .25s ease-out;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    overflow-y: auto;
}

#page-content-wrapper { width: 100%; min-height: 100vh; transition: margin .25s ease-out; }

.sidebar-heading {
    padding: 1rem 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    background: var(--sidebar-bg);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.sidebar-logo { max-height: 42px; max-width: 100%; object-fit: contain; }

#sidebar-wrapper { margin-left: -17rem; }
#page-content-wrapper { margin-left: 0; }

body.sb-sidenav-toggled #sidebar-wrapper { margin-left: 0 !important; }

@media (max-width: 768px) {
    body.sb-sidenav-toggled::before {
        content: "";
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(15, 17, 30, 0.55);
        z-index: 999;
    }
}

@media (min-width: 768px) {
    #sidebar-wrapper { margin-left: 0; }
    #page-content-wrapper { margin-left: 17rem; }
    body.sb-sidenav-toggled #sidebar-wrapper { margin-left: -17rem !important; }
    body.sb-sidenav-toggled #page-content-wrapper { margin-left: 0 !important; }
}

.list-group-item {
    border: none;
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.2s;
    margin: 2px 0.75rem;
    width: calc(100% - 1.5rem);
    border-radius: 10px;
}
.list-group-item:hover { background-color: var(--sidebar-bg-alt); color: var(--sidebar-text-hover); }
.list-group-item.active {
    background-color: var(--accent);
    color: #fff;
    border-left: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.list-group-item i { width: 22px; text-align: center; margin-right: 10px; }

.sidebar-divider { height: 0; margin: 0.5rem 1.5rem; overflow: hidden; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-title { color: #6b7095; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 1rem 1.5rem 0.5rem; letter-spacing: 0.08em; }

#sidebar-wrapper::-webkit-scrollbar { width: 5px; }
#sidebar-wrapper::-webkit-scrollbar-track { background: var(--sidebar-bg); }
#sidebar-wrapper::-webkit-scrollbar-thumb { background: #3a3f5c; border-radius: 10px; }

/* ---------------------------------------------------
   DASHBOARD SHELL: TOP NAVBAR
----------------------------------------------------- */
.top-navbar {
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.balance-card {
    background: var(--success-bg);
    color: var(--success);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid #d7f4e2;
    display: inline-flex;
    align-items: center;
}

.no-arrow::after { display: none !important; }

.navbar-nav .dropdown { position: relative; }
.navbar-nav .dropdown-menu {
    position: absolute !important;
    top: 100%;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem;
    z-index: 1030;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg) !important;
    min-width: 200px;
}

#sidebarToggle { border-radius: 8px; }

/* ---------------------------------------------------
   AUTH PAGES (login / register / activate)
----------------------------------------------------- */
.auth-shell { min-height: 100vh; }

.left-panel {
    background: linear-gradient(135deg, var(--accent) 0%, #7c81f2 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.1); }
.circle.c1 { width: 250px; height: 250px; top: -50px; left: -50px; }
.circle.c2 { width: 350px; height: 350px; bottom: -80px; right: -80px; }

.feature-box {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    transition: transform 0.25s;
    position: relative;
    z-index: 2;
}
.feature-box:hover { transform: translateY(-5px); }
.feature-icon { font-size: 1.5rem; color: #fff; opacity: 0.9; margin-bottom: 5px; }

.right-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--surface);
}

.login-card, .register-card, .activation-card {
    width: 100%;
    max-width: 400px;
}
.register-card { max-width: 500px; }
.activation-card { max-width: 420px; margin: 0 auto; }

.brand-icon {
    width: 70px; height: 70px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

/* Auth-scoped form control treatment (kept local to auth cards so
   dashboard form controls elsewhere are unaffected) */
.right-panel .form-control,
.right-panel .form-select {
    padding: 12px;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}
.right-panel .form-control:focus,
.right-panel .form-select:focus {
    background-color: #fff;
    border-color: var(--accent);
    box-shadow: none;
}

.icon-box {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}

.amount-box {
    background: var(--surface-alt);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}
.amount-value { font-size: 2rem; font-weight: 800; color: var(--text); }

.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem var(--accent-light);
}

input[readonly] { background-color: var(--surface-alt) !important; cursor: not-allowed; }

.btn-login, .btn-register {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: 0.2s;
}
.btn-login:hover, .btn-register:hover { background: var(--accent-dark); color: #fff; }

@media (max-width: 991px) {
    .left-panel { min-height: auto; padding: 4rem 1.5rem; text-align: center; }
    .right-panel { min-height: auto; padding: 4rem 1.5rem; }
    .display-5 { font-size: 2rem; }
}

/* ---------------------------------------------------
   INSTALLER WIZARD (install/)
----------------------------------------------------- */
.installer-shell {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
}
.install-card {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}
.install-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.install-step-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
    background: var(--surface-alt);
    color: var(--text-faint);
    border: 2px solid var(--border);
}
.install-step-dot.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.install-step-dot.current { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.install-step-line { width: 36px; height: 2px; background: var(--border); }
.install-step-line.done { background: var(--accent); }

.req-check-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.req-check-list li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
}
.req-check-list .req-pass { color: var(--success); }
.req-check-list .req-fail { color: var(--danger); }
