:root {
    --ni-dark: #1d1e1c;
    --ni-dark-2: #272926;
    --ni-blue: #1c83b5;
    --ni-blue-dark: #116b96;
    --ni-blue-soft: #eaf5fa;
    --ni-bg: #f4f7f9;
    --ni-surface: #ffffff;
    --ni-border: #e3e9ed;
    --ni-text: #20262b;
    --ni-muted: #73808a;
    --ni-success: #24875d;
    --ni-danger: #c94b50;
    --ni-warning: #b87816;
    --ni-radius: 14px;
    --ni-shadow: 0 12px 35px rgba(22, 37, 47, .08);
}

html, body { min-height: 100%; }
body.ni-userpanel, body.ni-login-page {
    background: var(--ni-bg);
    color: var(--ni-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
}
a { color: var(--ni-blue); }
a:hover { color: var(--ni-blue-dark); text-decoration: none; }

/* App shell */
.ni-layout { min-height: 100vh; display: flex; }
.ni-sidebar {
    width: 270px; flex: 0 0 270px; min-height: 100vh; padding: 26px 18px 22px;
    background: var(--ni-dark); color: #fff; display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1030;
}
.ni-brand { padding: 2px 10px 24px; border-bottom: 1px solid rgba(255,255,255,.09); }
.ni-brand-link { display: block; }
.ni-brand-logo { display: block; max-width: 185px; max-height: 65px; object-fit: contain; object-position: left center; }
.ni-brand-wordmark { font-weight: 800; letter-spacing: .08em; font-size: 24px; color: #fff; }
.ni-brand-subtitle { display: block; margin-top: 10px; font-size: 11px; line-height: 1.35; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .07em; }
.ni-sidebar-nav { padding: 22px 0; display: flex; flex-direction: column; gap: 4px; }
.ni-nav-link { color: rgba(255,255,255,.75); padding: 11px 12px; border-radius: 10px; display: flex; align-items: center; min-height: 44px; transition: .18s ease; }
.ni-nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.ni-nav-link.active { color: #fff; background: var(--ni-blue); box-shadow: 0 8px 20px rgba(28,131,181,.25); }
.ni-nav-icon { width: 31px; flex: 0 0 31px; text-align: center; font-size: 16px; }
.ni-nav-label { font-weight: 600; letter-spacing: .01em; }
.ni-sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.09); padding: 18px 10px 0; }
.ni-session-label, .ni-session-expiry span { color: rgba(255,255,255,.48); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.ni-session-user { font-size: 13px; font-weight: 600; margin: 3px 0 13px; line-height: 1.35; }
.ni-session-expiry { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ni-session-expiry strong { color: #8bd5f5; font-size: 13px; }

.ni-main { min-width: 0; flex: 1; }
.ni-topbar { height: 74px; padding: 0 32px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--ni-border); display: flex; align-items: center; position: sticky; top: 0; z-index: 1020; }
.ni-topbar-spacer { flex: 1; }
.ni-topbar-user { align-items: center; gap: 18px; margin-right: 18px; padding-right: 18px; border-right: 1px solid var(--ni-border); }
.ni-topbar-user > div { display: flex; flex-direction: column; text-align: right; }
.ni-topbar-user small { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ni-muted); }
.ni-topbar-user strong { max-width: 300px; font-size: 13px; font-weight: 600; }
.ni-topbar-timer { background: var(--ni-blue-soft); color: var(--ni-blue-dark); border-radius: 999px; padding: 6px 10px; font-weight: 700; font-size: 12px; }
.ni-logout { display: inline-flex; align-items: center; gap: 7px; color: #59656d; font-weight: 600; font-size: 13px; }
.ni-logout:hover { color: var(--ni-danger); }
.ni-mobile-brand, .ni-menu-toggle { display: none; }
.ni-content { padding: 28px 34px 42px; max-width: 1500px; margin: 0 auto; }
.ni-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.ni-page-heading h1 { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.ni-page-heading p { margin: 5px 0 0; color: var(--ni-muted); font-size: 13px; }
.ni-page-context { background: #fff; border: 1px solid var(--ni-border); color: var(--ni-muted); border-radius: 999px; padding: 7px 11px; font-size: 12px; }

/* Bootstrap/LMS modernization */
.card, .modal-content, .list-group, .table-responsive, .jumbotron {
    border-color: var(--ni-border) !important;
}
.card { border-radius: var(--ni-radius); box-shadow: 0 4px 18px rgba(22,37,47,.045); overflow: hidden; margin-bottom: 18px; }
.card-header { background: #fbfcfd; border-bottom: 1px solid var(--ni-border); padding: 15px 18px; }
.card-header strong { font-weight: 700; }
.list-group-item { border-color: var(--ni-border); padding: 13px 18px; }
.list-group-item strong { color: #4a565f; }
.nav-tabs { border-bottom: 1px solid var(--ni-border); gap: 4px; margin-bottom: 18px !important; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ni-muted); padding: 11px 15px; font-weight: 600; }
.nav-tabs .nav-link:hover { border-color: transparent; color: var(--ni-blue); }
.nav-tabs .nav-link.active { color: var(--ni-blue); background: transparent; border-bottom-color: var(--ni-blue); }
.btn { border-radius: 9px; font-weight: 600; box-shadow: none !important; }
.btn-primary, input[type="submit"] { background-color: var(--ni-blue); border-color: var(--ni-blue); }
.btn-primary:hover, input[type="submit"]:hover { background-color: var(--ni-blue-dark); border-color: var(--ni-blue-dark); }
.btn-secondary { background: #eef2f4; border-color: #dde4e8; color: #4e5a62; }
.form-control, select.form-control, textarea.form-control { border: 1px solid #d8e0e5; border-radius: 9px; min-height: 42px; background: #fff; }
.form-control:focus { border-color: #7bbbd9; box-shadow: 0 0 0 3px rgba(28,131,181,.11); }
.alert { border: 0; border-radius: 11px; padding: 13px 16px; }
.alert-info { color: #175d7d; background: #e8f5fb; }
.alert-success { color: #226744; background: #e8f6ef; }
.alert-warning { color: #77530d; background: #fff4da; }
.alert-danger { color: #8a373c; background: #fdebed; }
.badge { padding: .4em .65em; border-radius: 999px; font-weight: 600; }
.table-responsive { background: #fff; border: 1px solid var(--ni-border); border-radius: var(--ni-radius); overflow-x: auto; box-shadow: 0 4px 18px rgba(22,37,47,.04); }
.table { margin-bottom: 0; background: #fff; }
.table th { border-top: 0; border-bottom: 1px solid var(--ni-border) !important; color: #55616a; font-size: 12px; text-transform: uppercase; letter-spacing: .035em; font-weight: 700; background: #f8fafb; }
.table td { border-color: #edf1f3; }
.table-striped tbody tr:nth-of-type(odd) { background-color: #fbfcfd; }
.table-hover tbody tr:hover, tr.highlight { background: #eef8fc !important; }
.bg-primary, .lms-userpanel-table-header { background-color: var(--ni-dark) !important; }
.modal-content { border-radius: 16px; box-shadow: var(--ni-shadow); }
.modal-header, .modal-footer { border-color: var(--ni-border); }

/* Legacy custom-module markup */
table[border="1"], table[border="1"] td, table[border="1"] th { border-color: var(--ni-border) !important; }
.light, .lucid { background: #fff; }
.dark { background: #f6f9fa; }
.info { background: var(--ni-blue-soft); }
.success { background: #e9f6ef; }
FONT[color="blue"], font[color="blue"] { color: var(--ni-blue) !important; }
FONT[color="red"], font[color="red"] { color: var(--ni-danger) !important; }
FONT[color="green"], font[color="green"] { color: var(--ni-success) !important; }

/* Branded reusable blocks */
.ni-card { background: #fff; border: 1px solid var(--ni-border); border-radius: var(--ni-radius); box-shadow: 0 5px 20px rgba(22,37,47,.05); margin-bottom: 20px; overflow: hidden; }
.ni-card-header { padding: 17px 20px; border-bottom: 1px solid var(--ni-border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ni-card-header h2, .ni-card-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.ni-card-body { padding: 20px; }
.ni-card-muted { color: var(--ni-muted); }
.ni-stat { border-radius: 12px; background: #f7fafb; padding: 16px; }
.ni-stat-label { display: block; color: var(--ni-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.ni-stat-value { font-size: 22px; line-height: 1.15; font-weight: 700; }
.ni-balance-negative { color: var(--ni-danger); }
.ni-balance-positive { color: var(--ni-success); }
.ni-service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ni-service-card { background: #fff; border: 1px solid var(--ni-border); border-radius: 13px; padding: 18px; }
.ni-service-card h3 { font-size: 16px; margin: 0 0 14px; }
.ni-kv { display: grid; grid-template-columns: minmax(125px, 42%) 1fr; gap: 8px 16px; align-items: baseline; }
.ni-kv dt { margin: 0; color: var(--ni-muted); font-weight: 600; font-size: 12px; }
.ni-kv dd { margin: 0; font-weight: 600; }
.ni-empty { text-align: center; padding: 42px 22px; color: var(--ni-muted); }
.ni-empty i { display: block; font-size: 34px; color: #9fcadd; margin-bottom: 12px; }
.ni-year-month-links a { display: inline-block; min-width: 38px; text-align: center; padding: 6px 8px; margin: 3px; border: 1px solid var(--ni-border); border-radius: 8px; background: #fff; }
.ni-year-month-links a.active { background: var(--ni-blue); color: #fff; border-color: var(--ni-blue); }

/* Login */
body.ni-login-page { margin: 0; overflow-x: hidden; }
.ni-login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 43%) 1fr; }
.ni-login-brand-panel { position: relative; overflow: hidden; background: var(--ni-dark); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 60px 64px 34px; }
.ni-login-brand-panel::before { content: ""; position: absolute; width: 520px; height: 520px; right: -270px; top: -180px; border-radius: 50%; border: 80px solid rgba(28,131,181,.18); }
.ni-login-brand-panel::after { content: ""; position: absolute; width: 340px; height: 340px; left: -170px; bottom: -180px; border-radius: 50%; background: rgba(28,131,181,.12); }
.ni-login-brand-content, .ni-login-brand-footer { position: relative; z-index: 1; max-width: 520px; }
.ni-login-logo-wrap img { max-width: 220px; max-height: 78px; object-fit: contain; object-position: left center; }
.ni-login-kicker { margin-top: 70px; color: #70c5ea; font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.ni-login-brand-panel h1 { margin: 14px 0 18px; font-size: clamp(35px, 4vw, 54px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; }
.ni-login-brand-panel p { color: rgba(255,255,255,.65); font-size: 16px; line-height: 1.7; max-width: 470px; }
.ni-login-feature-list { margin-top: 34px; display: grid; gap: 13px; }
.ni-login-feature-list div { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.82); }
.ni-login-feature-list i { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; justify-content: center; align-items: center; background: rgba(28,131,181,.22); color: #83d3f4; }
.ni-login-brand-footer { font-size: 11px; color: rgba(255,255,255,.35); letter-spacing: .12em; }
.ni-login-form-panel { display: flex; align-items: center; justify-content: center; padding: 45px 28px; background: linear-gradient(135deg, #f7fafb 0%, #eef4f7 100%); }
.ni-login-card { width: 100%; max-width: 455px; background: #fff; border: 1px solid var(--ni-border); border-radius: 20px; box-shadow: var(--ni-shadow); padding: 38px 42px; }
.ni-login-mobile-logo { display: none; }
.ni-login-eyebrow { display: inline-block; color: var(--ni-blue); background: var(--ni-blue-soft); border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.ni-login-header h2 { margin: 13px 0 5px; font-size: 27px; font-weight: 700; letter-spacing: -.025em; }
.ni-login-header p { color: var(--ni-muted); margin: 0 0 26px; }
.ni-login-form label { font-weight: 600; font-size: 13px; color: #4b565e; }
.ni-login-form .form-control { min-height: 48px; padding: 10px 13px; }
.ni-primary-button { min-height: 48px; margin-top: 9px; }
.ni-login-secondary-action { text-align: center; margin-top: 18px; font-size: 13px; }
.ni-login-alert { margin: -10px 0 22px; font-size: 13px; }
.ni-remind-title h3 { font-size: 19px; margin-bottom: 4px; }
.ni-remind-title p { color: var(--ni-muted); font-size: 13px; margin-bottom: 18px; }
.ni-remind-tabs { display: flex; gap: 6px; background: #f1f5f7; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.ni-remind-tabs button { flex: 1; border: 0; border-radius: 8px; background: transparent; padding: 8px 10px; color: var(--ni-muted); font-weight: 600; }
.ni-remind-tabs button.active { background: #fff; color: var(--ni-blue); box-shadow: 0 2px 6px rgba(20,40,50,.08); }

div.g-recaptcha > div { margin-left: auto; margin-right: auto; }

@media (max-width: 991.98px) {
    .ni-sidebar { display: none; }
    .ni-topbar { height: 66px; padding: 0 18px; }
    .ni-mobile-brand { display: flex; align-items: center; max-width: 155px; }
    .ni-mobile-brand img { max-width: 150px; max-height: 44px; object-fit: contain; object-position: left center; }
    .ni-menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; margin-left: 12px; padding: 7px; border: 0; }
    .ni-menu-toggle span { width: 22px; height: 2px; background: #4f5a61; display: block; }
    .ni-mobile-menu { background: #fff; border-bottom: 1px solid var(--ni-border); padding: 8px 14px 12px; }
    .ni-mobile-nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; color: #4d5961; font-weight: 600; }
    .ni-mobile-nav-link.active { color: var(--ni-blue); background: var(--ni-blue-soft); }
    .ni-mobile-nav-link i:first-child { width: 22px; text-align: center; }
    .ni-content { padding: 24px 18px 38px; }
    .ni-page-context { display: none; }
    .ni-login-shell { grid-template-columns: 1fr; }
    .ni-login-brand-panel { display: none; }
    .ni-login-form-panel { min-height: 100vh; padding: 25px 18px; }
    .ni-login-mobile-logo { display: block; margin-bottom: 25px; }
    .ni-login-mobile-logo img { max-width: 190px; max-height: 65px; object-fit: contain; }
}

@media (max-width: 575.98px) {
    .ni-content { padding-left: 12px; padding-right: 12px; }
    .ni-topbar { padding-left: 12px; padding-right: 12px; }
    .ni-logout span { display: none; }
    .ni-page-heading h1 { font-size: 22px; }
    .ni-login-card { padding: 28px 22px; border-radius: 16px; }
    .ni-kv { grid-template-columns: 1fr; gap: 2px; }
    .table-responsive { border-radius: 10px; }
}

/* Custom NETIONE modules */
.ni-bank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ni-bank-card { margin: 0; cursor: pointer; }
.ni-bank-card > input { position: absolute; opacity: 0; pointer-events: none; }
.ni-bank-card > span { min-height: 120px; padding: 12px; border: 1px solid var(--ni-border); border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: .15s ease; }
.ni-bank-card > span:hover, .ni-bank-card > input:checked + span { border-color: #6bb2d3; box-shadow: 0 6px 18px rgba(28,131,181,.12); transform: translateY(-1px); }
.ni-bank-card img { max-width: 120px; max-height: 46px; object-fit: contain; }
.ni-bank-card small { font-weight: 600; margin-top: 8px; color: #44515a; }
.ni-bank-card em { font-style: normal; font-size: 10px; color: var(--ni-muted); margin-top: 3px; }
.ni-tv-hero { min-height: 110px; border-radius: var(--ni-radius); padding: 22px 25px; background: linear-gradient(115deg, var(--ni-dark), #283942); display: flex; align-items: center; gap: 24px; color: #fff; overflow: hidden; }
.ni-tv-hero img { max-width: 180px; max-height: 70px; object-fit: contain; }
.ni-tv-hero div { display: flex; flex-direction: column; }
.ni-tv-hero strong { font-size: 20px; }
.ni-tv-hero span { color: rgba(255,255,255,.58); font-size: 13px; margin-top: 3px; }
.ni-stb-image { max-width: 100%; max-height: 165px; object-fit: contain; border-radius: 8px; }
.ni-stat-accent { background: linear-gradient(135deg, #eef8fc, #f8fcfd); border: 1px solid #d9edf6; }
.ni-account-summary .ni-stat { height: 100%; }
.ni-login-form input:invalid,
.ni-login-form input:invalid:focus,
.ni-login-form select:invalid,
.ni-login-form select:invalid:focus {
    border-color: #d8e0e5;
    box-shadow: none;
}
/* Logo presentation for the current NETIONE dark wordmark */
.ni-brand-logo { background: #fff; padding: 5px 8px; border-radius: 5px; }
.ni-login-logo-wrap { display: inline-block; background: #fff; padding: 8px 12px; border-radius: 6px; }
.ni-login-logo-wrap img { display: block; }
