/* Reproduces the legacy "Stall Master" skin (collapsed nav-sm Gentelella as
   customized by Content/admin.css): blue icon-tile sidebar, orange brand/accents,
   dark charcoal top bar / footer / table headers. Authoritative layer over BS5. */

:root {
    --sm-sidebar: #1071b8;     /* blue sidebar */
    --sm-accent:  #FC7E27;     /* orange brand / buttons / active */
    --sm-dark:    #272a2f;     /* charcoal top bar / footer / table head */
    --sm-content: #eef0f3;     /* grey content area */
    --sm-side-w:  82px;
}

html, body {
    font-family: "Helvetica Neue", Roboto, Arial, sans-serif;
    font-size: 13px;
    color: #444;
    background: var(--sm-dark);
}

/* full-width shell (BS5 .container is fixed-width by default) */
.container.body { max-width: none !important; width: 100%; padding: 0; margin: 0; }
.main_container { position: relative; }

/* ===== Sidebar (blue, fixed, icon tiles) ===== */
.left_col {
    background: var(--sm-sidebar);
    width: var(--sm-side-w);
    position: fixed;
    top: 0; left: 0; height: 100vh;
    /* overflow must stay visible so the hover fly-out menus can escape the sidebar */
    overflow: visible;
    z-index: 1000;
}
/* keep overflow visible so hover fly-outs are not clipped (12 top-level tiles fit the viewport) */
#sidebar-menu { overflow: visible; }

/* orange brand block with the logo symbol */
.nav_title {
    background: var(--sm-accent);
    width: 100%;
    height: 57px;
    display: flex; align-items: center; justify-content: center;
    border: 0; margin: 0; padding: 6px;
}
.nav_title img.logo-symbol { max-width: 44px; max-height: 40px; }

#sidebar-menu { border-top: 1px solid #fff; }
.menu_section { margin: 0; }
/* Bootstrap 5's .nav is display:flex/flex-wrap, which packs the icon tiles
   horizontally. Force the menu back to a vertical block list (legacy BS3 behaviour). */
ul.nav.side-menu { display: block !important; list-style: none; margin: 0; padding: 0; width: 100%; }
ul.nav.side-menu > li { display: block !important; width: 100% !important; float: none !important; }
.nav.side-menu > li {
    position: relative !important;
    display: block !important;
    float: none !important;
    border-bottom: 1px solid rgba(255,255,255,.55);
}
/* body.nav-sm prefix (specificity 0,3,x) beats custom.css '.nav-sm .nav.side-menu li a' */
body.nav-sm .nav.side-menu > li > a {
    display: block !important;
    text-align: center !important;
    padding: 11px 3px !important;
    color: #fff !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
    margin: 0 !important;
    float: none !important;
}
body.nav-sm .nav.side-menu > li > a > i {
    display: block !important;
    float: none !important;
    font-size: 22px !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 0 5px 0 !important;
}
/* the chevron sits small, centered under the label (not floated right) */
body.nav-sm .nav.side-menu > li > a .fa-chevron-down {
    display: inline !important;
    float: none !important;
    font-size: 9px !important;
    margin: 0 0 0 4px !important;
    color: #cfe0f0 !important;
}
.nav.side-menu > li:hover { background: rgba(0,0,0,.12); }
.nav.side-menu > li:hover,
.nav.side-menu > li:has(> a.active) { border-right: 5px solid var(--sm-accent); }

/* fly-out child menus (Purchases / Settings / Security) on hover.
   High specificity + !important to override Gentelella's nav-sm submenu rules. */

body .nav.side-menu > li.parent:hover > ul.child_menu { display: block !important; }
body .nav.side-menu > li.parent > ul.child_menu > li {
    border: 0 !important;
}
body .nav.side-menu > li.parent > ul.child_menu > li > a {
    display: block !important;
    text-align: left !important;
    white-space: nowrap;
    padding: 9px 18px !important;
    color: #eaf2fb !important;
    font-size: 12.5px !important;
    text-decoration: none;
}
body .nav.side-menu > li.parent > ul.child_menu > li > a > i { display: inline !important; width: auto; font-size: 12.5px; margin-right: 8px; }
body .nav.side-menu > li.parent > ul.child_menu > li > a:hover,
body .nav.side-menu > li.parent > ul.child_menu > li > a.active { background: rgba(0,0,0,.28); color: #fff !important; }

/* ===== Top bar (dark charcoal) ===== */
.top_nav { margin-left: var(--sm-side-w); }
.top_nav .nav_menu {
    background: var(--sm-dark);
    border-bottom: 1px solid #000;
    min-height: 57px;
    display: flex; align-items: center; gap: 16px;
    padding: 0 18px;
    color: #fff;
}
#menu_toggle { background: none; border: 0; color: #4aa3df; font-size: 20px; cursor: pointer; }
.top_nav .store-name { color: #fff; font-size: 17px; margin: 0; }
.top_nav .app-title { color: #fff; font-size: 20px; margin: 0 auto; font-weight: 500; }
.top_nav .user-profile { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.top_nav .user-profile img { width: 30px; height: 30px; border-radius: 50%; background: #fff; object-fit: cover; }
.top_nav .dropdown-menu { font-size: 13px; }

/* ===== Content ===== */
.right_col {
    background: var(--sm-content);
    margin-left: var(--sm-side-w);
    padding: 16px 18px 0;
    min-height: calc(100vh - 57px);
}
/* modern content card: soft shadow instead of a hard border */
.x_panel {
    background: #fff;
    border: 0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
.x_content > h1:first-child {
    font-size: 19px; font-weight: 500; color: #2f3a46;
    margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #eef0f3;
}

/* dark headers only for plain (non-Mud) tables that remain, e.g. Sales/Reports/detail views */
.x_panel table:not(.mud-table-root) thead th { background: var(--sm-dark); color: #fff; border-color: var(--sm-dark); font-weight: 600; }
.x_panel .table:not(.mud-table-root) { font-size: 12px; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: #f1f1f1; }

/* MudDataGrid sits flush inside the card */
.x_content .mud-table-root { font-size: 13px; }
.mud-table-toolbar { padding-left: 0 !important; padding-right: 0 !important; }

/* Action cells use Bootstrap's `.d-flex justify-center`, but `display:flex` on a
   <td> removes it from the table column grid — the icons then stack vertically in
   one column and the rows balloon. Force the cells back to real table-cells and
   center the icon with text-align (MudIconButton is inline-flex, so this works). */
.mud-table-cell.d-flex {
    display: table-cell !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap;
}
/* tighten the single-icon action columns so they don't eat horizontal space */
.mud-table-root td.mud-table-cell.d-flex { width: 1%; padding-left: 4px; padding-right: 4px; }
.mud-table-root .mud-table-cell .mud-button-root.mud-icon-button { margin: 0 auto; }

/* compact colored icon action buttons for table rows (legacy look) */
.btn-act {
    display: inline-block;
    padding: 5px 9px;
    margin: 0 1px;
    border: 0;
    border-radius: 3px;
    color: #fff !important;
    font-size: 12px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.btn-act > i { margin: 0; }
.btn-act.view { background: #e0a82e; }
.btn-act.view:hover { background: #c8901c; }
.btn-act.edit { background: #2f7bbf; }
.btn-act.edit:hover { background: #256298; }
.btn-act.del  { background: #d64541; }
.btn-act.del:hover  { background: #b8332f; }

/* orange primary/success buttons */
.btn-primary, .btn-success { background-color: var(--sm-accent); border-color: var(--sm-accent); color: #fff; }
.btn-primary:hover, .btn-success:hover { background-color: #e06a14; border-color: #e06a14; }
.btn-outline-primary { color: #1071b8; border-color: #1071b8; }
.btn-outline-primary:hover { background-color: #1071b8; border-color: #1071b8; }

/* ===== POS page ===== */
.pos-title {
    font-size: 16px; font-weight: 600; color: #2f3a46;
    margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #eef0f3;
}
.pos-label { display: block; font-size: 12px; font-weight: 600; color: #5a6573; margin: 0 0 2px; }
/* cart + picker tables keep the legacy dark header (they are plain, non-Mud tables) */
table.pos-cart thead th { background: var(--sm-dark); color: #fff; border-color: #3a3d42; font-weight: 600; font-size: 12px; }
table.pos-cart td { vertical-align: middle; font-size: 12.5px; }
table.pos-cart tfoot td { background: #f6f7f9; }
table.pos-cart input.form-control-sm { display: inline-block; }
/* summary box (No. of Items / Total / Amount Collected / Balance) */
.pos-summary { border: 1px solid #e2e6ea; border-radius: 8px; overflow: hidden; }
.pos-summary-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-bottom: 1px solid #e9edf1; font-size: 14px;
}
.pos-summary-row:last-child { border-bottom: 0; }
.pos-summary-row span { color: #5a6573; font-weight: 600; }
.pos-summary-row b { font-size: 16px; color: #2f3a46; }
.pos-summary-row.pos-balance { background: #f6f7f9; }
/* Select Product grid: clickable rows */
.pos-picker .mud-table-row:hover { cursor: pointer; }

/* ===== Footer ===== */
footer.copy {
    margin-left: var(--sm-side-w);
    background: var(--sm-dark);
    color: #cfd3d8;
    text-align: center;
    padding: 14px 20px;
}

/* ===== Expanded mode (hamburger) — show wider sidebar with inline labels ===== */
body.nav-expanded { }
body.nav-expanded .left_col { width: 230px; }
body.nav-expanded .top_nav,
body.nav-expanded .right_col,
body.nav-expanded footer.copy { margin-left: 230px; }
body.nav-expanded .nav.side-menu > li > a { text-align: left; padding: 12px 18px; font-size: 13px; }
body.nav-expanded .nav.side-menu > li > a > i { display: inline-block; width: 22px; font-size: 16px; margin: 0 10px 0 0; }

@media (max-width: 768px) {
    .left_col { left: calc(-1 * var(--sm-side-w)); transition: left .2s; }
    body.sidebar-open .left_col { left: 0; }
    .top_nav, .right_col, footer.copy { margin-left: 0; }
}
