/*!
 * IPPro Networks - theme overlay for PHPNuxBill
 *
 * Loaded last, on top of bootstrap 3 + modern-AdminLTE. Restyles the stock
 * chrome rather than replacing it, so every one of the app's templates picks
 * up the new look without being forked.
 *
 * Rebranding: edit the :root block. Everything else derives from it.
 */

/* Palette follows the DHIS2 design system: a flat blue application bar,
   a white side navigation, and a light grey working canvas. */
/* Palette and proportions follow the reference admin console: a muted slate
   application bar, a white side navigation with grouped sections, and a
   near-white working canvas with hairline-bordered surfaces. */
:root {
    /* Application bar */
    --ip-header:        #3d5a80;
    --ip-header-line:   rgba(255, 255, 255, .16);
    --ip-header-text:   #ffffff;
    --ip-header-dim:    rgba(255, 255, 255, .78);
    --ip-header-fill:   rgba(255, 255, 255, .13);

    /* Brand / interactive */
    --ip-primary:       #2c4a6e;
    --ip-primary-hover: #24405f;
    --ip-primary-soft:  #eef3f9;
    --ip-selected:      #dce7f3;
    --ip-primary-line:  #cfe0f0;
    --ip-primary-text:  #2c5282;
    --ip-accent:        #3d5a80;

    /* Surfaces */
    --ip-bg:            #fbfcfd;
    --ip-surface:       #ffffff;
    --ip-line:          #e5e7eb;
    --ip-line-2:        #f1f3f5;
    --ip-hover:         #f7f8fa;
    --ip-text:          #111827;
    --ip-text-2:        #374151;
    --ip-muted:         #6b7280;
    --ip-faint:         #9ca3af;

    /* Status */
    --ip-success:       #15803d;
    --ip-info:          #2c5282;
    --ip-warning:       #b45309;
    --ip-danger:        #b42318;

    --ip-radius:        8px;
    --ip-radius-sm:     6px;
    --ip-shadow:        0 1px 2px rgba(16, 24, 40, .05);
    --ip-shadow-lg:     0 8px 24px rgba(16, 24, 40, .12);
    --ip-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Helvetica Neue", Arial, sans-serif;
    --ip-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ------------------------------------------------------------------ base */
body,
.content-wrapper,
.main-footer {
    font-family: var(--ip-font);
    color: var(--ip-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { background: var(--ip-bg); font-size: 14px; line-height: 1.5; }

h1, h2, h3, h4, h5, h6, .box-title {
    font-family: var(--ip-font);
    color: var(--ip-text);
    letter-spacing: -.01em;
}

a { color: var(--ip-primary-text); transition: color .12s ease; }
a:hover, a:focus { color: var(--ip-primary); }

::selection { background: var(--ip-primary-line); color: var(--ip-text); }

/* ------------------------------------------------------- application bar */
.main-header { position: relative; }

/* Fixed shell: the bar and the navigation stay put, the page body scrolls.
   AdminLTE ships a `.fixed` body class for this, but it hard-codes a 50px
   header offset, so the geometry is set here against our own 56px bar.
   Below 768px AdminLTE stacks the logo above the navbar and slides the
   sidebar off-canvas, so the shell is left in normal flow there. */
@media (min-width: 768px) {
    .main-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
    }

    .main-sidebar,
    .left-side {
        position: fixed;
        top: 0;
        bottom: 0;
        padding-top: 56px;
    }

    .main-sidebar .sidebar {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .content-wrapper,
    .right-side { padding-top: 56px; }
}

/* Keep the navigation scrollbar from cutting into the hairline border. */
.main-sidebar .sidebar::-webkit-scrollbar { width: 6px; }
.main-sidebar .sidebar::-webkit-scrollbar-thumb {
    background: var(--ip-line);
    border-radius: 3px;
}
.main-sidebar .sidebar::-webkit-scrollbar-thumb:hover { background: var(--ip-faint); }
.main-sidebar .sidebar { scrollbar-width: thin; scrollbar-color: var(--ip-line) transparent; }

/* The bar is one surface: AdminLTE splits it into a .logo block and a
   .navbar, which default to different heights and tones and leave a visible
   seam at the sidebar boundary. Pin both to the same height and colour. */
.main-header .navbar,
.main-header .logo,
.main-header .logo:hover {
    background: var(--ip-header);
    border-bottom: none;
    box-shadow: none;
    height: 56px;
    min-height: 56px;
    line-height: normal;
}

.main-header .navbar { position: relative; margin-left: 230px; }
.main-header .logo { width: 230px; }

/* Left block aligns with the sidebar and carries the app-launcher mark. */
.main-header .logo {
    font-family: var(--ip-font);
    font-weight: 400;
    font-size: 15px;
    color: var(--ip-header-text);
    border-right: none;
    text-align: left;
    padding: 0 16px;
    display: flex;
    align-items: center;
}
.main-header .logo .logo-lg { display: flex; align-items: center; gap: 11px; }
.main-header .logo .app-waffle { opacity: .9; flex: none; }
.main-header .logo .app-name { font-weight: 600; letter-spacing: -.012em; }

.main-header .sidebar-toggle { color: var(--ip-header-dim); }
.main-header .sidebar-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main-header .navbar .nav > li > a {
    color: var(--ip-header-dim);
    transition: background .12s ease, color .12s ease;
}
.main-header .navbar .nav > li > a:hover,
.main-header .navbar .nav > li > a:focus,
.main-header .navbar .nav .open > a,
.main-header .navbar .nav .open > a:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main-header .navbar .user-menu > a { padding: 12px 14px; display: flex; align-items: center; }
.main-header .navbar .user-menu .user-name { font-size: 13.5px; }
.main-header .navbar .user-menu .user-caret { margin-left: 8px; opacity: .7; font-size: 13px; }

/* Initials avatar. An uploaded photo is layered over the top and removes
   itself when it 404s, which is the normal case - the stock template fell
   back to a shared admin.default.png for every account. */
.user-avatar {
    position: relative;
    overflow: hidden;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ip-header-fill);
    color: var(--ip-header-text);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}
.main-header .navbar .user-menu .user-avatar { margin-right: 10px; }
.user-avatar > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-avatar.user-avatar-lg {
    width: 40px;
    height: 40px;
    font-size: 14px;
    background: var(--ip-primary-soft);
    color: var(--ip-primary-text);
}

/* Account menu. AdminLTE's stock user menu is a 175px blue-gradient panel
   with a photographic backdrop; this is a plain popover instead. */
.main-header .navbar .user-menu .dropdown-menu {
    width: 268px;
    padding: 0;
    margin-top: 4px;
    background: var(--ip-surface);
    border: 1px solid var(--ip-line);
    border-radius: var(--ip-radius);
    box-shadow: var(--ip-shadow-lg);
    overflow: hidden;
}

.account-menu .account-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ip-line-2);
}
.account-menu .account-identity-text { min-width: 0; line-height: 1.35; }
.account-menu .account-identity-text strong {
    display: block;
    color: var(--ip-text);
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-menu .account-identity-text small { color: var(--ip-muted); font-size: 12px; }

.account-menu .account-links,
.account-menu .account-foot { padding: 6px; }
.account-menu .account-foot { border-top: 1px solid var(--ip-line-2); }

.account-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--ip-radius-sm);
    color: var(--ip-text-2);
    font-size: 13.5px;
    transition: background-color .12s ease, color .12s ease;
}
.account-menu a > svg { flex: none; color: var(--ip-faint); }
.account-menu a:hover,
.account-menu a:focus { background: var(--ip-hover); color: var(--ip-text); text-decoration: none; }
.account-menu a:hover > svg { color: var(--ip-muted); }
.account-menu .account-foot a:hover { color: var(--ip-danger); }
.account-menu .account-foot a:hover > svg { color: var(--ip-danger); }

/* Search reads as a field but opens the existing overlay on click. */
.main-header .navbar .wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.main-header .navbar #openSearch,
.main-header .navbar .search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 420px;
    max-width: 42vw;
    background: var(--ip-header-fill);
    border: 1px solid transparent;
    border-radius: var(--ip-radius-sm);
    color: var(--ip-header-dim);
    font-family: var(--ip-font);
    font-size: 13.5px;
    padding: 8px 13px;
    text-align: left;
    transition: background .12s ease, border-color .12s ease;
}
.main-header .navbar #openSearch:hover {
    background: rgba(255, 255, 255, .19);
    border-color: rgba(255, 255, 255, .22);
    color: #fff;
}
.main-header .navbar #openSearch .fa { font-size: 13px; opacity: .85; }
.main-header .navbar #openSearch .search-label { opacity: .9; }

@media (max-width: 991px) {
    .main-header .navbar .wrap { display: none; }
}

/* -------------------------------------------------------- side navigation */
.main-sidebar,
.left-side,
.main-sidebar .sidebar {
    background: var(--ip-surface);
    border-right: 1px solid var(--ip-line);
}

.sidebar-menu > li > a {
    /* phpnuxbill.css sets .sidebar-menu li>a{background-color:rgb(28 36 52)}
       with no skin prefix, so it survives dropping modern-skin-dark and has
       to be cleared explicitly. */
    background-color: transparent;
    color: var(--ip-text-2);
    font-weight: 400;
    font-size: 14px;
    border-left: none;
    border-radius: var(--ip-radius-sm);
    margin: 1px 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    transition: background-color .12s ease, color .12s ease;
}

/* Same file sets a green hover colour on every descendant of a menu item. */
.sidebar-menu li:focus,
.sidebar-menu li :hover { color: inherit; }

.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .ion,
.sidebar-menu > li > a > .glyphicon {
    width: 26px;
    color: var(--ip-faint);
    font-size: 15px;
    font-weight: 400;
    transition: color .12s ease;
}

/* AdminLTE puts the caret in a floated container; keep it right-aligned
   inside the flex row instead. */
.sidebar-menu > li > a > .pull-right-container { position: static; margin-left: auto; }
.sidebar-menu > li > a > .pull-right-container > .fa-angle-left { width: auto; font-size: 13px; }

.sidebar-menu > li:hover > a,
.sidebar-menu > li.menu-open > a { background-color: var(--ip-hover); color: var(--ip-text); }
.sidebar-menu > li:hover > a > .fa,
.sidebar-menu > li:hover > a > .ion { color: var(--ip-muted); }

.sidebar-menu > li.active > a {
    background-color: var(--ip-selected);
    color: var(--ip-primary-text);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--ip-primary-text);
}
.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li.active > a > .ion { color: var(--ip-primary-text); }

.sidebar-menu .treeview-menu { background: transparent; margin: 0; padding: 1px 0 4px; }
/* The dark fill from phpnuxbill.css is set on every .sidebar-menu li>a, not
   just top-level ones, so the nested items need it cleared too. */
.sidebar-menu .treeview-menu li > a { background-color: transparent; }
.sidebar-menu .treeview-menu > li > a {
    background-color: transparent;
    color: var(--ip-muted);
    font-size: 13.5px;
    padding: 7px 12px 7px 46px;
    margin: 1px 8px;
    border-radius: var(--ip-radius-sm);
}
.sidebar-menu .treeview-menu > li > a:hover { color: var(--ip-text); background: var(--ip-hover); }
.sidebar-menu .treeview-menu > li.active > a { color: var(--ip-primary-text); font-weight: 600; background-color: var(--ip-selected); }

/* Grouped section labels, as in the reference navigation. */
.sidebar-menu li.header {
    color: var(--ip-faint);
    background: transparent;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .07em;
    font-weight: 600;
    padding: 20px 20px 7px;
}

.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a {
    background: var(--ip-primary-soft);
    color: var(--ip-primary-text);
}
.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
    background: var(--ip-surface);
    border: 1px solid var(--ip-line);
    border-left: none;
    border-radius: 0 var(--ip-radius) var(--ip-radius) 0;
    box-shadow: var(--ip-shadow-lg);
    padding: 4px 0;
}

/* Collapse control, docked to the foot of the navigation. */
.sidebar-foot {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: var(--ip-surface);
    border-top: 1px solid var(--ip-line);
}
.sidebar-foot .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ip-radius-sm);
    color: var(--ip-muted);
    background: transparent;
    transition: background-color .12s ease, color .12s ease;
}
.sidebar-foot .sidebar-toggle:hover { background-color: var(--ip-hover); color: var(--ip-text); }

/* Keep the last menu item clear of the docked control. */
.main-sidebar .sidebar { padding-bottom: 52px; }

.user-panel {
    border-bottom: 1px solid var(--ip-line);
    padding: 14px 16px;
    background: var(--ip-surface);
}
.user-panel > .image > img { border: none; }
.user-panel > .info > p { color: var(--ip-text); font-weight: 500; }
.user-panel > .info > a { color: var(--ip-muted); }

/* --------------------------------------------------------------- content */
.content-wrapper, .right-side { background: var(--ip-bg); }

.content-header { padding: 24px 24px 4px; background: transparent; position: relative; }
.content-header > h1 {
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -.022em;
    margin: 0;
    color: var(--ip-text);
}
.content-header > h1 > small {
    display: block;
    color: var(--ip-muted);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    margin-top: 5px;
}

/* Breadcrumb sits above the title, as a trail rather than a floated pill. */
.content-header > .breadcrumb {
    position: static;
    float: none;
    background: transparent;
    padding: 0 0 10px;
    margin: 0;
    font-size: 13px;
}
.content-header > .breadcrumb > li > a { color: var(--ip-muted); }
.content-header > .breadcrumb > li > a:hover { color: var(--ip-primary-text); }
.content-header > .breadcrumb > .active { color: var(--ip-text-2); font-weight: 500; }
.content-header > .breadcrumb > li + li:before { content: "\203A"; color: var(--ip-faint); padding: 0 8px; }
.content-header > .breadcrumb > li > a > .fa { display: none; }

.content { padding: 16px 24px 24px; }

/* ----------------------------------------------------------- boxes/cards */
.box, .panel, .info-box, .nav-tabs-custom {
    background: var(--ip-surface);
    border: 1px solid var(--ip-line);
    border-top: 1px solid var(--ip-line);
    border-radius: var(--ip-radius) !important;
    box-shadow: var(--ip-shadow);
}

.box-header {
    border-bottom: 1px solid var(--ip-line);
    padding: 15px 18px;
    color: var(--ip-text);
}
.box-header .box-title { font-size: 15px; font-weight: 600; letter-spacing: -.008em; }
.box-body { padding: 18px; }
.box-footer {
    border-top: 1px solid var(--ip-line);
    background: transparent;
    border-radius: 0 0 var(--ip-radius) var(--ip-radius);
    padding: 14px 18px;
}

/* Keep the coloured status rule, but as a hairline rather than a slab. */
.box.box-primary { border-top: 2px solid var(--ip-primary); }
.box.box-info    { border-top: 2px solid var(--ip-info); }
.box.box-success { border-top: 2px solid var(--ip-success); }
.box.box-warning { border-top: 2px solid var(--ip-warning); }
.box.box-danger  { border-top: 2px solid var(--ip-danger); }

/* Box tool buttons are chrome, not actions - AdminLTE renders them as
   solid coloured buttons by default. */
.box-header .box-tools .btn {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--ip-faint) !important;
    padding: 4px 8px;
    box-shadow: none;
}
.box-header .box-tools .btn:hover {
    background-color: var(--ip-hover) !important;
    color: var(--ip-text-2) !important;
}

/* ------------------------------------------------------- dashboard tiles */
/* Restrained metric cards on the light canvas rather than saturated blocks. */
.small-box {
    border-radius: var(--ip-radius);
    border: 1px solid var(--ip-line);
    box-shadow: var(--ip-shadow);
    overflow: hidden;
    background-color: var(--ip-surface) !important;
    color: var(--ip-text);
}
.small-box > .inner { padding: 18px 18px 14px; }
.small-box h3 {
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -.03em;
    margin: 0 0 2px;
    color: var(--ip-text);
}
.small-box h3 > small { font-size: 15px; color: var(--ip-muted); font-weight: 500; }
.small-box p { font-size: 13px; color: var(--ip-muted); margin: 0; }
.small-box .icon { display: none; }

.small-box > .small-box-footer {
    background: transparent;
    border-top: 1px solid var(--ip-line-2);
    color: var(--ip-muted);
    font-size: 12px;
    padding: 9px;
}
.small-box > .small-box-footer:hover { background: var(--ip-hover); color: var(--ip-primary-text); }

/* The palette classes become a top accent rule instead of a fill. */
.small-box.bg-aqua   { border-top: 3px solid #3d5a80; }
.small-box.bg-green  { border-top: 3px solid #15803d; }
.small-box.bg-yellow { border-top: 3px solid #b45309; }
.small-box.bg-red    { border-top: 3px solid #b42318; }
.small-box.bg-blue   { border-top: 3px solid #2c5282; }
.small-box.bg-purple { border-top: 3px solid #6b4fa0; }
.small-box.bg-teal   { border-top: 3px solid #0f766e; }

.info-box { border-radius: var(--ip-radius); }
.info-box-icon { border-radius: var(--ip-radius) 0 0 var(--ip-radius); }

/* --------------------------------------------------------------- buttons */
.btn {
    border-radius: var(--ip-radius-sm);
    font-family: var(--ip-font);
    font-weight: 500;
    font-size: 13.5px;
    padding: 8px 15px;
    border: 1px solid transparent;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:focus, .btn:active:focus { outline: none; box-shadow: 0 0 0 3px rgba(61, 90, 128, .2); }
.btn-flat { border-radius: var(--ip-radius-sm); }
.btn-sm, .btn-xs { border-radius: 5px; }

/* modern-AdminLTE pins every variant's colours with !important. */
.btn-primary { background-color: var(--ip-primary) !important; border-color: var(--ip-primary) !important; color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background-color: var(--ip-primary-hover) !important; border-color: var(--ip-primary-hover) !important; }

.btn-success { background-color: var(--ip-success) !important; border-color: var(--ip-success) !important; color: #fff; }
.btn-success:hover, .btn-success:focus { background-color: #126b33 !important; border-color: #126b33 !important; }
.btn-info    { background-color: var(--ip-info) !important; border-color: var(--ip-info) !important; color: #fff; }
.btn-info:hover, .btn-info:focus { background-color: #24446d !important; border-color: #24446d !important; }
.btn-warning { background-color: var(--ip-warning) !important; border-color: var(--ip-warning) !important; color: #fff; }
.btn-warning:hover, .btn-warning:focus { background-color: #96460a !important; border-color: #96460a !important; color: #fff; }
.btn-danger  { background-color: var(--ip-danger) !important; border-color: var(--ip-danger) !important; color: #fff; }
.btn-danger:hover, .btn-danger:focus { background-color: #971a13 !important; border-color: #971a13 !important; }

.btn-default {
    background-color: var(--ip-surface) !important;
    border-color: var(--ip-line) !important;
    color: var(--ip-text-2) !important;
}
.btn-default:hover, .btn-default:focus {
    background-color: var(--ip-hover) !important;
    border-color: #d5d9e0 !important;
}

/* ----------------------------------------------------------------- forms */
.form-control {
    border-radius: var(--ip-radius-sm);
    border: 1px solid var(--ip-line);
    box-shadow: none;
    height: auto;
    padding: 9px 12px;
    font-size: 14px;
    font-family: var(--ip-font);
    color: var(--ip-text);
    background: var(--ip-surface);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-control:focus {
    border-color: var(--ip-accent);
    box-shadow: 0 0 0 3px rgba(61, 90, 128, .13);
}
.form-control::placeholder { color: var(--ip-faint); }

label { font-weight: 500; font-size: 13px; color: var(--ip-text-2); margin-bottom: 6px; }
.help-block { color: var(--ip-muted); font-size: 12.5px; }

.input-group-addon {
    border-radius: var(--ip-radius-sm);
    border-color: var(--ip-line);
    background: var(--ip-hover);
    color: var(--ip-muted);
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: var(--ip-radius-sm) !important;
    border-color: var(--ip-line) !important;
    min-height: 38px;
}

/* ---------------------------------------------------------------- tables */
.table { margin-bottom: 0; }

.table > thead > tr > th {
    border-bottom: 1px solid var(--ip-line);
    border-top: none;
    background: transparent;
    color: var(--ip-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .055em;
    padding: 12px 16px;
    white-space: nowrap;
}
.table > tbody > tr > td {
    border-top: 1px solid var(--ip-line-2);
    padding: 14px 16px;
    vertical-align: middle;
    color: var(--ip-text-2);
}
.table > tbody > tr:first-child > td { border-top: none; }
.table-hover > tbody > tr:hover { background: var(--ip-hover); }
.table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
.table > tbody > tr > td a { color: var(--ip-primary-text); font-weight: 500; }

/* Identifiers read better set in mono, as in the reference table. */
.table td code,
.table td .mono {
    font-family: var(--ip-mono);
    font-size: 12.5px;
    color: var(--ip-primary-text);
    background: transparent;
    padding: 0;
}


/* ------------------------------------------------------- labels & badges */
.label, .badge {
    border-radius: 999px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: .02em;
    padding: 4px 10px;
}
.label-primary { background: var(--ip-primary); }
.label-success { background: var(--ip-success); }
.label-info    { background: var(--ip-info); }
.label-warning { background: var(--ip-warning); }
.label-danger  { background: var(--ip-danger); }

/* ------------------------------------------------- modals & dropdowns */
.modal-content {
    border-radius: var(--ip-radius);
    border: none;
    box-shadow: var(--ip-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--ip-line); padding: 16px 20px; }
.modal-header .modal-title { font-weight: 620; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--ip-line); padding: 14px 20px; }
.modal-backdrop.in { opacity: .45; }

.dropdown-menu {
    border-radius: var(--ip-radius-sm);
    border: 1px solid var(--ip-line);
    box-shadow: var(--ip-shadow-lg);
    padding: 6px;
}
.dropdown-menu > li > a { border-radius: 6px; padding: 8px 12px; font-size: 13.5px; }
.dropdown-menu > li > a:hover { background: var(--ip-primary-soft); color: var(--ip-primary); }

/* --------------------------------------------------- alerts & callouts */
.alert, .callout {
    border-radius: var(--ip-radius-sm);
    border: 1px solid transparent;
    border-left-width: 4px;
    box-shadow: none;
    padding: 13px 16px;
}
.alert-success { background: #ecfdf5; border-color: var(--ip-success); color: #065f46; }
.alert-info    { background: #eff6ff; border-color: var(--ip-info);    color: #075985; }
.alert-warning { background: #fffbeb; border-color: var(--ip-warning); color: #92400e; }
.alert-danger  { background: #fef2f2; border-color: var(--ip-danger);  color: #991b1b; }

/* ------------------------------------------------------- tabs & paging */
.nav-tabs { border-bottom: 1px solid var(--ip-line); }
.nav-tabs > li > a { border: none; color: var(--ip-muted); font-weight: 550; border-radius: 0; padding: 11px 16px; }
.nav-tabs > li > a:hover { background: transparent; color: var(--ip-primary); }
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
    border: none;
    border-bottom: 2px solid var(--ip-primary);
    color: var(--ip-primary);
    background: transparent;
}
.nav-tabs-custom > .nav-tabs > li.active { border-top-color: var(--ip-primary); }

.pagination > li > a, .pagination > li > span {
    border-color: var(--ip-line);
    color: var(--ip-text);
    margin: 0 2px;
    border-radius: var(--ip-radius-sm) !important;
    padding: 7px 13px;
}
.pagination > li > a:hover { background: var(--ip-primary-soft); border-color: var(--ip-primary); color: var(--ip-primary); }
.pagination > .active > a, .pagination > .active > span,
.pagination > .active > a:hover {
    background: var(--ip-primary);
    border-color: var(--ip-primary);
}

/* ---------------------------------------------------------------- misc */
.main-footer {
    background: var(--ip-surface);
    border-top: 1px solid var(--ip-line);
    color: var(--ip-muted);
    font-size: 12.5px;
    padding: 14px 20px;
}

.progress { border-radius: 999px; height: 8px; box-shadow: none; background: #eceef5; }
.progress-bar { border-radius: 999px; box-shadow: none; }

hr { border-top-color: var(--ip-line); }

/* Scrollbars, where the browser lets us style them. */
* { scrollbar-width: thin; scrollbar-color: #c3c8d6 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3c8d6; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a7aec2; background-clip: content-box; }

/* =====================================================================
   DARK MODE
   phpnuxbill.css already ships ~170 .dark-mode rules. These come later in
   the cascade and match their specificity, so they win without !important.
   ===================================================================== */
body.dark-mode {
    --ip-bg:      #0b0f1a;
    --ip-surface: #151b2b;
    --ip-line:    #242c40;
    --ip-text:    #e6e9f2;
    --ip-muted:   #94a0ba;
    --ip-primary-soft: rgba(99, 102, 241, .13);

    background: var(--ip-bg);
    color: var(--ip-text);
}

body.dark-mode .content,
body.dark-mode .content-header,
body.dark-mode .content-wrapper,
body.dark-mode .right-side { background: var(--ip-bg); color: var(--ip-text); }

body.dark-mode .main-header .logo,
body.dark-mode .main-header .navbar,
body.dark-mode .main-sidebar,
body.dark-mode .main-sidebar .sidebar { background: #080c15; }

body.dark-mode .box,
body.dark-mode .panel,
body.dark-mode .info-box,
body.dark-mode .nav-tabs-custom,
body.dark-mode .modal-content {
    background: var(--ip-surface);
    border-color: var(--ip-line);
    color: var(--ip-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .28);
}

body.dark-mode .box-header,
body.dark-mode .panel-heading,
body.dark-mode .modal-header { background: transparent; border-bottom-color: var(--ip-line); color: var(--ip-text); }
body.dark-mode .box-footer,
body.dark-mode .panel-footer,
body.dark-mode .modal-footer { background: transparent; border-top-color: var(--ip-line); }
body.dark-mode .box-header .box-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5 { color: var(--ip-text); }

body.dark-mode .form-control,
body.dark-mode .input-group-addon {
    background: #101725;
    border-color: var(--ip-line);
    color: var(--ip-text);
}
body.dark-mode .form-control:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .2); }
body.dark-mode .form-control::placeholder { color: #6b7488; }
body.dark-mode label { color: var(--ip-text); }

body.dark-mode .table > thead > tr > th { color: var(--ip-muted); border-bottom-color: var(--ip-line); }
body.dark-mode .table > tbody > tr > td { border-top-color: var(--ip-line); color: var(--ip-text); }
body.dark-mode .table-hover > tbody > tr:hover { background: rgba(99, 102, 241, .1); }
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) { background: rgba(255, 255, 255, .015); }

body.dark-mode .btn-default { background: #1b2233; border-color: var(--ip-line); color: var(--ip-text); }
body.dark-mode .btn-default:hover { background: #232c42; border-color: #333d57; }

body.dark-mode .dropdown-menu { background: var(--ip-surface); border-color: var(--ip-line); }
body.dark-mode .dropdown-menu > li > a { color: var(--ip-text); }
body.dark-mode .dropdown-menu > li > a:hover { background: rgba(99, 102, 241, .16); color: #a5b4fc; }

body.dark-mode .main-footer { background: var(--ip-surface); border-top-color: var(--ip-line); color: var(--ip-muted); }
body.dark-mode .nav-tabs { border-bottom-color: var(--ip-line); }
body.dark-mode .pagination > li > a,
body.dark-mode .pagination > li > span { background: var(--ip-surface); border-color: var(--ip-line); color: var(--ip-text); }
body.dark-mode .progress { background: #1b2233; }
body.dark-mode a { color: #a5b4fc; }
body.dark-mode a:hover { color: #c7d2fe; }

body.dark-mode .alert-success { background: rgba(5, 150, 105, .13); color: #6ee7b7; }
body.dark-mode .alert-info    { background: rgba(2, 132, 199, .13); color: #7dd3fc; }
body.dark-mode .alert-warning { background: rgba(217, 119, 6, .13); color: #fcd34d; }
body.dark-mode .alert-danger  { background: rgba(220, 38, 38, .13); color: #fca5a5; }

body.dark-mode * { scrollbar-color: #333d57 transparent; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #333d57; background-clip: content-box; }

/* ==================================================================
   LOGIN
   Used by the forked admin login template and the customer portal.
   ================================================================== */
body.login-page,
body.register-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

body.login-page .login-box,
body.register-page .register-box { width: 400px; max-width: 100%; margin: 0; }

body.login-page .login-logo {
    color: #fff;
    font-weight: 650;
    letter-spacing: -.02em;
    font-size: 27px;
    margin-bottom: 8px;
    text-align: center;
}

body.login-page .login-logo small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, .62);
    letter-spacing: .01em;
    margin-top: 6px;
}

body.login-page .login-box-body {
    background: rgba(255, 255, 255, .97);
    border-radius: 16px;
    border: none;
    padding: 30px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .38);
}

body.login-page .login-box-msg {
    color: var(--ip-muted);
    font-weight: 500;
    font-size: 13.5px;
    padding: 0 0 20px;
    margin: 0;
}

body.login-page .form-control { padding: 11px 13px; }
body.login-page .btn-primary { padding: 11px 16px; font-size: 14px; margin-bottom: 0; }
body.login-page .back-link { color: var(--ip-muted); font-size: 13px; }
body.login-page .back-link:hover { color: var(--ip-primary); }
