/* =============================================================
   Estride Brand · UI Tier 1 visual lift
   =============================================================

   Loaded LAST in the ~/Content/css bundle so it overrides
   Bootstrap 3 + Inspinia defaults without changing any view
   markup. Drop tokens here; the rest of the app picks them up
   through the class overrides below.

   Palette mirrors the mobile app (lib/src/theme/app_colors.dart)
   so web + iOS + Android all share one brand identity.
   ============================================================= */

:root {
    /* Brand */
    --estride-primary: #124C44;       /* deep teal — primary CTA */
    --estride-primary-dark: #0B2F2A;
    --estride-primary-light: #1D5B52;
    --estride-accent: #C58B3F;        /* warm gold — secondary CTA */
    --estride-accent-soft: #E7C896;

    /* Surfaces */
    --estride-bg: #F7F4EE;            /* warm cream body bg */
    --estride-card: #FFFFFF;
    --estride-muted: #EFEAE0;
    --estride-outline: #D9D3C7;

    /* Typography */
    --estride-text: #1B2421;
    --estride-text-secondary: #5E6B66;
    --estride-text-muted: #8A938F;

    /* Status */
    --estride-success: #2E8B57;
    --estride-warning: #E8A33D;
    --estride-danger: #C0392B;
    --estride-info: #1F6FB1;

    /* Per-product brand tints (sensor pages) */
    --estride-harmony: #124C44;
    --estride-precision: #2BACD3;
    --estride-steady: #7A4E2D;
    --estride-stance: #5B5DD9;

    /* Geometry */
    --estride-radius: 16px;
    --estride-radius-sm: 10px;
    --estride-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    --estride-shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.10);
}

/* --- Light only ----------------------------------------------- */
/* Dark mode was removed by request — the shell is always light,
   regardless of OS prefers-color-scheme. Pin color-scheme to light
   so native form controls + scrollbars stay light too. */
body { color-scheme: light; }

/* --- Typography ----------------------------------------------- */

body,
.navbar,
.btn,
.form-control,
.panel,
.modal {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "cv11", "ss01";
}

body {
    background-color: var(--estride-bg);
    color: var(--estride-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    color: var(--estride-text);
    letter-spacing: -0.01em;
}

a { color: var(--estride-primary); }
a:hover, a:focus { color: var(--estride-primary-dark); }

/* --- Layout chrome -------------------------------------------- */

/* Force-light shell — neutralize Inspinia's dark surfaces so no part
   of the app chrome ever renders dark. Inspinia ships
   `body { background:#2f4050 }` and `.sameassidebar-bg { background:#253949 }`
   (the dark dashboard-header band). Hardcoded light values here (not
   var) so these can't collapse to the upstream navy if the brand
   custom properties fail to resolve. */
html,
body,
#page-wrapper,
.gray-bg,
.wrapper.wrapper-content {
    background-color: #F7F4EE;
}

.sameassidebar-bg,
.dashboard-header {
    background-color: #FFFFFF;
    color: #1B2421;
}

.dashboard-header h1,
.dashboard-header h2,
.dashboard-header h3,
.dashboard-header label,
.sameassidebar-bg label {
    color: #1B2421;
}

#page-wrapper.white-bg,
.wrapper.wrapper-content,
.ibox-content {
    background-color: var(--estride-card, #FFFFFF);
}

.ibox {
    border-radius: var(--estride-radius);
    box-shadow: var(--estride-shadow);
    border: 0;
    overflow: hidden;
}

.ibox-title {
    background: var(--estride-card);
    border-bottom: 1px solid var(--estride-outline);
    border-radius: var(--estride-radius) var(--estride-radius) 0 0;
    padding: 18px 22px 16px;
}

.ibox-title h5 {
    font-weight: 700;
    color: var(--estride-text);
    margin: 0;
}

.ibox-content {
    border: 0;
    padding: 20px 22px 22px;
    border-radius: 0 0 var(--estride-radius) var(--estride-radius);
}

/* --- Cards / Panels (Bootstrap 3) ----------------------------- */

.panel, .panel-default {
    border: 0;
    border-radius: var(--estride-radius);
    box-shadow: var(--estride-shadow);
}

.panel-heading {
    background: var(--estride-card);
    border-bottom: 1px solid var(--estride-outline);
    border-radius: var(--estride-radius) var(--estride-radius) 0 0;
    padding: 16px 20px;
    font-weight: 700;
}

.panel-body {
    padding: 20px;
}

/* --- Buttons -------------------------------------------------- */

.btn {
    border-radius: var(--estride-radius-sm);
    font-weight: 600;
    padding: 9px 18px;
    transition: background-color .15s ease, box-shadow .15s ease,
                transform .05s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background-color: var(--estride-primary);
    border-color: var(--estride-primary);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--estride-primary-dark);
    border-color: var(--estride-primary-dark);
}

.btn-default {
    background-color: var(--estride-card);
    border-color: var(--estride-outline);
    color: var(--estride-text);
}
.btn-default:hover {
    background-color: var(--estride-muted);
    border-color: var(--estride-outline);
}

.btn-success { background-color: var(--estride-success); border-color: var(--estride-success); }
.btn-warning { background-color: var(--estride-warning); border-color: var(--estride-warning); }
.btn-danger  { background-color: var(--estride-danger);  border-color: var(--estride-danger); }
.btn-info    { background-color: var(--estride-info);    border-color: var(--estride-info); }

/* Brand accent — secondary CTA */
.btn-accent {
    background-color: var(--estride-accent);
    border-color: var(--estride-accent);
    color: #fff;
}
.btn-accent:hover {
    background-color: #A87326;
    border-color: #A87326;
    color: #fff;
}

/* --- Forms ---------------------------------------------------- */

.form-control {
    border-radius: var(--estride-radius-sm);
    border-color: var(--estride-outline);
    box-shadow: none;
    padding: 9px 12px;
    background-color: var(--estride-card);
    color: var(--estride-text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus {
    border-color: var(--estride-primary);
    box-shadow: 0 0 0 3px rgba(18, 76, 68, 0.12);
}

.input-group-addon {
    background-color: var(--estride-muted);
    border-color: var(--estride-outline);
    color: var(--estride-text-secondary);
    border-radius: var(--estride-radius-sm);
}

/* --- Tables --------------------------------------------------- */

.table > thead > tr > th {
    border-bottom: 2px solid var(--estride-outline);
    color: var(--estride-text-secondary);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 11px;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
    border-color: var(--estride-outline);
}

.table-hover > tbody > tr:hover {
    background-color: rgba(18, 76, 68, 0.04);
}

/* --- Top navbar + sidebar ------------------------------------- */

.navbar-default {
    background-color: var(--estride-card);
    border: 0;
    box-shadow: 0 1px 0 var(--estride-outline);
}

.nav > li > a {
    color: var(--estride-text);
}
.nav > li > a:hover,
.nav > li > a:focus {
    background-color: var(--estride-muted);
    color: var(--estride-primary);
}

/* Topbar items + dropdown menus — when the user hovers the avatar /
   bell / envelope nav-tops or a row inside the resulting dropdown,
   the previous "light grey on dark teal text" combo read as
   washed-out. Use a saturated dark grey backdrop with crisp white
   text so the hover state is unambiguously "this row". */
.navbar-top-links > li > a:hover,
.navbar-top-links > li > a:focus,
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-messages > li > a:hover,
.dropdown-messages > li > a:focus {
    background-color: #2D3942;
    color: #FFFFFF !important;
}

.dropdown-menu > li > a:hover > i,
.dropdown-menu > li > a:focus > i,
.dropdown-messages > li > a:hover > i,
.dropdown-messages > li > a:focus > i {
    color: #FFFFFF;
}

/* --- Modals --------------------------------------------------- */

.modal-content {
    border: 0;
    border-radius: var(--estride-radius);
    box-shadow: var(--estride-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--estride-outline);
    padding: 18px 22px;
}

.modal-footer {
    border-top: 1px solid var(--estride-outline);
    padding: 16px 22px;
}

/* --- Badges / labels ------------------------------------------ */

.label, .badge {
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 999px;
    padding: 4px 10px;
}

.label-primary, .badge-primary {
    background-color: rgba(18, 76, 68, 0.12);
    color: var(--estride-primary);
}

/* --- Scrollbar (Webkit) --------------------------------------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--estride-outline);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--estride-text-muted); }

/* --- Skeleton loaders ----------------------------------------- */
/*
   Drop-in placeholder blocks for content that's loading. Use instead
   of (or in addition to) the existing sk-spinner cube. They pick up
   the surface tokens so they shift cleanly between light and dark.

   Example:
     <div class="ibox">
       <div class="ibox-content">
         <div class="estride-skeleton estride-skeleton-title"></div>
         <div class="estride-skeleton estride-skeleton-text"></div>
         <div class="estride-skeleton estride-skeleton-text" style="width:60%"></div>
         <div class="estride-skeleton estride-skeleton-chart"></div>
       </div>
     </div>

   When real content arrives, swap the .estride-skeleton-* nodes out
   (jQuery .replaceWith or a server-rendered partial works equally).
*/

@keyframes estride-skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.estride-skeleton {
    display: block;
    width: 100%;
    height: 14px;
    border-radius: 6px;
    background-color: var(--estride-muted);
    background-image: linear-gradient(
        90deg,
        var(--estride-muted) 0%,
        var(--estride-outline) 40%,
        var(--estride-muted) 80%
    );
    background-size: 400px 100%;
    background-repeat: no-repeat;
    animation: estride-skeleton-shimmer 1.4s linear infinite;
    margin-bottom: 10px;
}

/* Common shapes — opinionated defaults, override with inline style
   or a more-specific class when needed. */
.estride-skeleton-title { height: 22px; width: 50%; border-radius: 8px; margin-bottom: 14px; }
.estride-skeleton-text  { height: 14px; width: 90%; }
.estride-skeleton-line  { height: 14px; width: 70%; }
.estride-skeleton-chip  { height: 24px; width: 70px; border-radius: 999px; display: inline-block; }
.estride-skeleton-chart { height: 160px; border-radius: var(--estride-radius-sm); margin: 14px 0 0; }
.estride-skeleton-card  { height: 90px;  border-radius: var(--estride-radius-sm); margin-bottom: 12px; }

/* Stack helper — render N text rows inside a single parent. */
.estride-skeleton-list .estride-skeleton + .estride-skeleton {
    margin-top: 6px;
}

/* --- Sidebar (Inspinia metisMenu restyle) --------------------- */
/*
   Inspinia ships the sidebar (_Navigation.cshtml) as a dark navbar
   with white text. The restyle below keeps the DOM intact so every
   metisMenu / jQuery / data-toggle hook continues to work — only
   the look shifts to the Estride palette (card-toned surface,
   brand-teal active states, modern spacing).

   Selectors are scoped to .navbar-static-side so the topbar
   (.navbar-static-top) is unaffected.
*/

/* The sidebar is intentionally DARK while the rest of the app is light.
   The Estride logo art is white (EStride_WHITE.png) so it needs a dark
   backing to read, and a dark rail looks sharper than the washed-out
   white/grey menu. Neutral cool slate — deliberately NOT the brand
   green/teal as a fill; teal appears only as the active-item accent.
   Hardcoded (not var) so it can't collapse if tokens fail to load. */
.navbar-static-side {
    background-color: #1F2933;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-static-side .nav-header {
    /* True black band behind the white logo — maximum contrast against
       the slate rail. Clear Inspinia's navy texture image so we control
       the colour cleanly. */
    background-color: #000000;
    background-image: none;
    padding: 24px 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    margin-bottom: 6px;
}

/* When the sidebar collapses (body.mini-navbar), Inspinia paints the
   nav-header with its accent green (#1ab394). Override to the same
   slate as the rest of the rail so the header blends in cleanly
   instead of leaving a coloured stub at the top. */
body.mini-navbar .navbar-static-side .nav-header,
body.mini-navbar .nav-header {
    background-color: #1F2933;
    background-image: none;
}

.navbar-static-side .profile-element strong,
.navbar-static-side .profile-element string {
    color: #EDEFF1;
    font-weight: 700;
}

.navbar-static-side .profile-element a {
    color: #EDEFF1;
}

/* Top-level items */
.navbar-static-side .nav > li > a {
    color: #AEB7BD;
    padding: 11px 18px;
    border-left: 3px solid transparent;
    border-radius: 0;
    font-weight: 500;
    transition: background-color .12s ease, color .12s ease,
                border-color .12s ease;
}

.navbar-static-side .nav > li > a:hover,
.navbar-static-side .nav > li > a:focus {
    background-color: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
    border-left-color: transparent;
}

.navbar-static-side .nav > li.active > a {
    background-color: rgba(43, 163, 138, 0.16);
    color: #FFFFFF;
    border-left-color: #2BA38A;
    font-weight: 700;
}

.navbar-static-side .nav > li.active > a > i {
    color: #2BA38A;
}

.navbar-static-side .nav > li > a > i {
    width: 18px;
    text-align: center;
    margin-right: 10px;
    color: #7E8890;
    transition: color .12s ease;
}

/* Second-level (and third-level) submenus — slightly inset + darker */
.navbar-static-side .nav-second-level,
.navbar-static-side .nav-third-level {
    background-color: rgba(0, 0, 0, 0.22);
}

.navbar-static-side .nav-second-level > li > a,
.navbar-static-side .nav-third-level > li > a {
    background-color: transparent;
    color: #9AA4AB;
    padding: 9px 18px 9px 46px;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.navbar-static-side .nav-third-level > li > a {
    padding-left: 60px;
    font-size: 13px;
}

.navbar-static-side .nav-second-level > li > a:hover,
.navbar-static-side .nav-third-level > li > a:hover,
.navbar-static-side .nav-second-level > li.active > a,
.navbar-static-side .nav-third-level > li.active > a {
    background-color: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}

.navbar-static-side .nav-second-level > li.active > a {
    color: #FFFFFF;
    border-left-color: #2BA38A;
    font-weight: 700;
}

.navbar-static-side .nav-label {
    letter-spacing: 0.01em;
}

/* Inspinia ships rotating arrows for accordion menus; align with
   the dark rail. */
.navbar-static-side .nav > li > a .fa.arrow,
.navbar-static-side .nav-second-level > li > a .fa.arrow {
    color: #7E8890;
    font-size: 12px;
}

/* Avatar inside the profile-element — transparent so the white logo
   sits directly on the dark header, no white box behind it. */
.navbar-static-side .profile-element .img-circle {
    border: 0;
    padding: 0;
    background: transparent;
}

/* Mobile / collapsed state — make sure the off-canvas drawer reads
   the same as the desktop sidebar so the visual shift on resize is
   minimal. */
@media (max-width: 768px) {
    .navbar-static-side {
        border-right: 0;
        box-shadow: var(--estride-shadow-lg);
    }
}
