/* ==========================================================================
   Modern theme — visual refresh layered on top of the legacy Bootstrap 3 /
   SB Admin 2 / menucool-accordion stack. No markup/class names changed
   anywhere; this file only restyles what's already there.
   ========================================================================== */

:root {
    --ink: #1e2330;
    --ink-muted: #6b7280;
    --line: #e5e7eb;
    --surface: #ffffff;
    --canvas: #f3f4f8;

    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-light: #eef2ff;

    --success: #16a34a;
    --success-dark: #15803d;
    --danger: #e11d48;
    --danger-dark: #be123c;
    --warning: #d97706;
    --warning-dark: #b45309;

    --sidebar-bg: #161a2b;
    --sidebar-bg-raised: #1f2540;
    --sidebar-text: #aab0c6;
    --sidebar-text-active: #ffffff;

    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-md: 0 4px 10px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover, a:focus { color: var(--brand-dark); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font); font-weight: 600; color: var(--ink); }

h3 { color: var(--ink) !important; }

/* ---------- Layout shell ---------- */

#wrapper {
    width: 100% !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#page-wrapper {
    background: transparent !important;
    padding: 28px 32px !important;
}

@media (min-width: 768px) {
    #page-wrapper { border-left: none !important; }
}

.copy_right {
    margin-top: auto;
    padding: 18px 0 28px;
    color: var(--ink-muted);
    font-size: 12px;
    background: transparent;
}

/* ---------- Top navbar ---------- */

.navbar.navbar-default {
    background: var(--surface) !important;
    border: none !important;
    box-shadow: 0 1px 0 var(--line), 0 1px 4px rgba(16, 24, 40, .04);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    min-height: 64px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 22px;
}

.navbar-default .navbar-brand {
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    display: flex;
    align-items: center;
    float: none;
}

.navbar-default .navbar-brand img {
    height: 2.6em !important;
    width: auto !important;
    display: block;
}

.top_nav {
    background: transparent;
}

    .top_nav ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
    }

    .top_nav li { display: inline-block; }

    .top_nav a {
        display: inline-block;
        padding: 9px 14px;
        font-size: 13px;
        font-weight: 500;
        color: var(--ink-muted);
        border-radius: var(--radius-sm);
        text-decoration: none;
        transition: background .15s ease, color .15s ease;
    }

        .top_nav a:hover { background: var(--brand-light); color: var(--brand-dark); }

.navbar-top-links.navbar-right {
    float: none !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
}

    .navbar-top-links .dropdown-toggle {
        color: var(--ink) !important;
        font-size: 13px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .navbar-top-links .dropdown-toggle .fa-user {
            background: var(--brand-light);
            color: var(--brand);
            width: 26px;
            height: 26px;
            line-height: 26px;
            text-align: center;
            border-radius: 50%;
            margin-left: 4px;
        }

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
}

    .dropdown-menu > li > a {
        border-radius: 6px;
        padding: 8px 12px;
        font-size: 13px;
        color: var(--ink);
    }

        .dropdown-menu > li > a:hover {
            background: var(--brand-light);
            color: var(--brand-dark);
        }

    .dropdown-menu .divider { display: none; }

/* ---------- Sidebar / accordion menu ---------- */

.navbar-default.sidebar {
    background: var(--sidebar-bg) !important;
    border-right: none;
    padding-top: 12px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, .12);
}

@media (min-width: 768px) {
    .navbar-default.sidebar {
        width: 190px !important;
        /* sb-admin-2.css makes .sidebar position:absolute here with no explicit "top", so it
           renders starting at its static-flow position - right below .topbar-inner - and used to
           just be as tall as its own (short) menu content. Pinning it to the real viewport instead
           (fixed, offset by the topbar's height) makes it a true full-height panel without its
           bottom edge running past the viewport and adding to the page's scrollable height. */
        position: fixed;
        top: 64px;
        bottom: 0;
        left: 0;
        overflow-y: auto;
    }

    #page-wrapper {
        margin-left: 190px !important;
    }
}

#accordion {
    font-family: var(--font) !important;
}

#accordion > ul > li.top {
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

#accordion li > div {
    font-family: var(--font) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sidebar-text) !important;
    padding-left: 16px !important;
}

#accordion .top.has-sub > div {
    cursor: pointer;
}

#accordion li li,
#accordion li li > a,
#accordion li li > div {
    background: transparent !important;
    font-family: var(--font) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-transform: none;
    letter-spacing: normal;
}

#accordion li li > a {
    color: var(--sidebar-text) !important;
    padding: 11px 16px 11px 34px !important;
    border-radius: 6px;
    margin: 1px 6px;
    transition: background .15s ease, color .15s ease;
}

    #accordion li li > a:hover {
        background: var(--sidebar-bg-raised) !important;
        color: var(--sidebar-text-active) !important;
    }

    #accordion li li > a.active {
        background: var(--brand) !important;
        color: #fff !important;
        font-weight: 500;
    }

#accordion div.caret {
    border-left-color: var(--sidebar-text) !important;
    opacity: .7;
}

#home > div > a,
#logOff > div > a {
    color: var(--sidebar-text) !important;
    padding: 12px 16px !important;
    display: block;
    border-radius: 6px;
    margin: 1px 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: background .15s ease, color .15s ease;
}

    #home > div > a:hover,
    #logOff > div > a:hover {
        background: var(--sidebar-bg-raised) !important;
        color: var(--sidebar-text-active) !important;
    }

    /* The legacy accordion-menu.css marks whichever link matches the current URL with a plain
       ".active" class and paints it hard blue (#276baf) — override that here so "Portal Home"
       matches the rest of the modern sidebar instead of standing out as a leftover legacy pill. */
    #home > div > a.active,
    #logOff > div > a.active {
        background: var(--brand) !important;
        color: #fff !important;
    }

#logOff { margin-top: 8px; }

    #logOff > div > a:hover {
        background: rgba(225, 29, 72, .15) !important;
        color: #fca5a5 !important;
    }

/* ---------- Panels / cards ---------- */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

.panel-default > .panel-heading {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    padding: 16px 22px;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
}

.panel-body {
    padding: 22px;
}

/* ---------- Buttons ---------- */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 16px;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

    .btn:active { transform: translateY(1px); }

.btn-default {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
}

    .btn-default:hover { background: #f9fafb; border-color: #d1d5db; color: var(--ink); }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
    .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
    .btn-success:hover { background: var(--success-dark); border-color: var(--success-dark); color: #fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
    .btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); color: #fff; }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
    .btn-warning:hover { background: var(--warning-dark); border-color: var(--warning-dark); color: #fff; }

.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: var(--radius-sm); }

/* Row-action buttons rendered inline as table links/badges (Edit) */
a.btn-success, a.btn-danger, a.btn-primary, a.btn-warning {
    display: inline-flex !important;
    align-items: center;
    padding: 6px 14px !important;
    font-size: 12.5px !important;
}

/* ---------- Forms ---------- */

label {
    font-weight: 500;
    color: var(--ink);
    font-size: 12px;
    margin-bottom: 6px;
}

.form-control,
input[type="text"], input[type="password"], input[type="number"], input[type="file"],
select, textarea {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 12.5px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus,
select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
    outline: none;
}

.form-group { margin-bottom: 18px; }

.checkbox label, .radio label { font-weight: 400; }

/* ---------- Tables ---------- */

.table-responsive {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.table {
    margin-bottom: 0;
}

    .table > thead > tr > th {
        border-bottom: 1px solid var(--line);
        background: #fafafc;
        color: var(--ink-muted);
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .05em;
        padding: 12px 16px;
    }

    .table > tbody > tr > td {
        padding: 13px 16px;
        border-top: 1px solid var(--line);
        vertical-align: middle;
        color: var(--ink);
        font-size: 12.5px;
    }

    .table > tbody > tr:hover > td {
        background: #fafbff;
    }

/* Legacy inline header-row styling used on a few grids — neutralize so our
   thead styling above wins instead of the old hard blue banner. */
[id$="gridView1"] tr:first-child,
[id$="gridview1"] tr:first-child,
[id$="gridview2"] tr:first-child {
    background-color: transparent !important;
    color: inherit !important;
}

/* ---------- Alerts ---------- */

.alert {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    padding: 12px 16px;
}

.alert-danger { background: #fef2f2; border-color: #fecdd3; color: var(--danger-dark); }
.alert-info { background: var(--brand-light); border-color: #c7d2fe; color: var(--brand-dark); }

/* ---------- Login page ---------- */

body:has(.login-panel) .col-md-4.col-md-offset-4 {
    float: none;
    width: 480px;
    max-width: 92vw;
    margin: 0 auto;
}

.login-panel.panel {
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
}

.login-panel .panel-heading {
    text-align: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 30px 30px 10px;
    border-bottom: none;
}

.login-panel .panel-title {
    font-size: 24px;
    font-weight: 700;
}

.login-panel .panel-body { padding: 24px 36px 40px; }

.login-panel .form-group { margin-bottom: 20px; }

.login-panel .form-control {
    height: 54px;
    font-size: 16px;
    padding: 14px 18px;
    border-radius: 10px;
}

.login-panel .btn-lg {
    height: 54px;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 18px;
    border-radius: 10px;
    letter-spacing: .02em;
}

body:has(.login-panel) {
    background: linear-gradient(180deg, #eef0fb 0%, var(--canvas) 320px);
}

/* ---------- View License page ---------- */

.license-page .panel-body {
    padding: 32px;
}

.license-page label {
    font-size: 12.5px;
}

.license-page .form-control {
    height: 44px;
    font-size: 13px;
    padding: 11px 16px;
}

.license-page .btn {
    height: 44px;
    font-size: 14px;
    padding: 10px 20px;
}

.license-page .table > thead > tr > th {
    font-size: 11px;
    padding: 14px 18px;
}

.license-page .table > tbody > tr > td {
    font-size: 13px;
    padding: 15px 18px;
}

.license-page a.btn-success {
    font-size: 13.5px !important;
    padding: 8px 16px !important;
}

/* Bootstrap forces .table to exactly 100% of its container, so with 10 columns of real content
   "auto" layout just compresses every column instead of growing them. Let the table grow past
   100% (nowrap keeps each column to its natural single-line width) and scroll horizontally inside
   #divid1 instead — columns end up as wide as their content actually needs. */
.license-page #gridView1 {
    width: auto;
    min-width: 100%;
}

    .license-page #gridView1 th,
    .license-page #gridView1 td {
        white-space: nowrap;
    }

    /* Address text is long and would otherwise force the whole table very wide — cap it and let it
       wrap instead of pushing every other column further off-screen. */
    .license-page #gridView1 th.col-address,
    .license-page #gridView1 td.col-address {
        width: 200px;
        max-width: 200px;
        white-space: normal;
    }

/* ---------- Generate License page ---------- */

.license-generate-page .panel-body {
    padding: 32px 40px;
}

.license-generate-page label {
    font-size: 13px;
    padding-top: 10px;
}

.license-generate-page .form-control {
    height: 44px;
    font-size: 13px;
    padding: 12px 16px;
}

.license-generate-page textarea.form-control {
    height: auto;
    padding: 14px 16px;
}

.license-generate-page .form-group {
    margin-bottom: 20px;
}

.license-generate-page button[type="submit"] {
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 36px;
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    letter-spacing: .02em;
}

    .license-generate-page button[type="submit"]:hover {
        background: var(--brand-dark);
        border-color: var(--brand-dark);
        color: #fff;
    }

/* The date fields' "add-on" calendar icon doubles as the widget's required positioning anchor
   (see the comment in Generate.cshtml) — style it as a normal icon affordance inside the input
   rather than the legacy Bootstrap-2 float layout. */
.license-generate-page .date-input-group,
.promo-add-page .date-input-group {
    position: relative;
}

    .license-generate-page .date-input-group .form-control,
    .promo-add-page .date-input-group .form-control {
        padding-right: 44px;
    }

    .license-generate-page .date-input-group .add-on,
    .promo-add-page .date-input-group .add-on {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ink-muted);
        cursor: pointer;
    }

/* ---------- Complex "Add" promotion pages (MealDeal/MealDealPrice/MixAndMatch/MultyBuy) ----------
   These pages have several differently-colored submit buttons sharing type="submit" (Search =
   neutral, Remove Product = red, final Submit = neutral) — unlike .license-generate-page, this
   class deliberately does NOT touch buttons, or a broad button[type=submit] rule would repaint the
   red "Remove Product" buttons indigo (a real mistake already made and reverted once already). */
.promo-add-page label {
    font-size: 13px;
}

.promo-add-page .form-control,
.promo-add-page select.form-control {
    height: 44px;
    font-size: 13.5px;
    padding: 10px 14px;
}

.promo-add-page textarea.form-control {
    height: auto;
}

.promo-add-page .form-group {
    margin-bottom: 16px;
}

.promo-add-page .table > thead > tr > th {
    font-size: 11.5px;
}

.promo-add-page .table > tbody > tr > td {
    font-size: 13px;
}

.promo-add-page .checkbox label {
    font-size: 15px;
}

/* The barcode search box next to this button is a .form-control - match the button's height to it
   (own class, not button[type=submit], for the same reason as .promo-submit-btn below: Remove
   Product shares type="submit" and must keep its red color). */
.promo-add-page .promo-search-btn {
    height: 44px;
    padding: 12px 16px;
    font-size: 13px;
}

/* Final submit button gets its own class (not button[type=submit]) so it doesn't also
   repaint the Search/Remove Product buttons that share type="submit" on this page. */
.promo-add-page .promo-submit-btn {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    height: 44px;
    padding: 0 32px;
    font-size: 15px;
    font-weight: 600;
}

    .promo-add-page .promo-submit-btn:hover,
    .promo-add-page .promo-submit-btn:focus {
        background: var(--brand-dark, #4338ca);
        border-color: var(--brand-dark, #4338ca);
        color: #fff;
    }

/* ---------- Change Date pages (MultyBuy/MixAndMatch/MealDeal/MealDealPrice) ---------- */
.changedate-page h4 {
    font-size: 16px;
}

.changedate-page .table > thead > tr > th {
    font-size: 11.5px;
    padding: 14px 18px;
    white-space: nowrap;
}

.changedate-page .table > tbody > tr > td {
    font-size: 13px;
    padding: 15px 18px;
    white-space: nowrap;
}

.changedate-page .form-control {
    height: 42px;
    font-size: 13px;
    padding: 10px 14px;
    min-width: 160px;
}

.changedate-page .btn {
    height: 40px;
    font-size: 14px;
    padding: 8px 18px;
}
