:root {
    --sidebar-w: 272px;
    --sidebar-collapsed: 72px;
    --topbar-main-h: 48px;
    --ops-console-h: 0px;
    --topbar-h: var(--topbar-main-h);

    /* Responsive breakpoints (use in @media max-width) */
    --bp-wide: 1200px;
    --bp-tablet: 900px;
    --bp-phone: 600px;

    --bg-app: #dce3ed;
    --bg-card: #f4f7fb;
    --bg-input: #ffffff;
    --text: #0f172a;
    --text-muted: #5b6b82;

    --sidebar-bg: #12161f;
    --sidebar-bg-2: #181e2a;
    --sidebar-border: #2a3344;
    --sidebar-text: #dde4ef;
    --sidebar-muted: #a8b4c4;
    --sidebar-hover: #232b3a;
    --sidebar-active: #2d3648;
    --accent: #c9a227;
    --accent-soft: rgba(201, 162, 39, 0.15);
    --accent-hover: #dbb94a;

    --topbar-bg: #1a2030;
    --topbar-text: #e8edf4;

    --outline-bright: #a8b8cf;
    --grid-line-bright: #c5d2e4;
    --radius-sm: 8px;
    --radius: 12px;
    --shadow-card: 0 4px 14px rgba(15, 23, 42, 0.08);

    --nav-submenu-font-size: 12px;
    --nav-submenu-icon-font-size: 10px;
}

/* ===== App shell ===== */

.app-body {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    margin: 0;
    background: var(--bg-app);
    color: var(--text);
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f1319 100%);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    overflow: visible;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.22s ease, visibility 0.22s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    text-decoration: none;
    background: #fff;
    border-radius: 8px;
    padding: 4px 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    transition: box-shadow 0.15s ease;
}

.brand-logo-link:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    object-position: center center;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, #8a7020 100%);
    color: #1a1408;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.brand-text strong {
    color: #f0f4fa;
    font-size: 14px;
    font-weight: 700;
}

.brand-text span {
    color: var(--sidebar-muted);
    font-size: 10px;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: #3d4a5e transparent;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list > li {
    position: relative;
    margin: 2px 8px;
}

.nav-link,
.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
}

.nav-icon {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--accent);
    font-size: 13px;
}

.nav-label {
    flex: 1;
}

.nav-chevron {
    color: var(--sidebar-muted);
    font-size: 14px;
    transition: transform 0.15s ease;
}

.nav-link:hover,
.nav-group-toggle:hover,
.nav-group.is-open > .nav-group-toggle {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-link.is-active,
.nav-submenu a.is-active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-group.is-open > .nav-group-toggle {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-group.is-open .nav-chevron {
    transform: rotate(90deg);
}

/* Inline expandable submenu — all items visible inside sidebar */
.nav-submenu {
    list-style: none;
    margin: 0 4px 6px;
    padding: 2px 0 4px;
    display: none;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent);
}

.nav-group.is-open .nav-submenu {
    display: block;
}

.nav-submenu li {
    margin: 0;
}

.nav-submenu a {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    padding: 8px 12px;
    margin: 1px 4px;
    border-radius: 6px;
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: var(--nav-submenu-font-size);
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-submenu-icon {
    width: auto;
    min-width: 1em;
    text-align: center;
    flex-shrink: 0;
    color: var(--accent);
    font-size: var(--nav-submenu-icon-font-size);
    line-height: 1.35;
}

.nav-submenu-label {
    flex: 1;
    min-width: 0;
}

.nav-submenu a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

/* Nested submenu (e.g. Accounting → Report) */
.nav-subgroup {
    margin: 0;
}

.nav-subgroup-toggle {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: calc(100% - 8px);
    margin: 1px 4px;
    padding: 8px 10px 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--sidebar-muted);
    font-size: var(--nav-submenu-font-size);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-subgroup-toggle:hover,
.nav-subgroup.is-open > .nav-subgroup-toggle {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-subgroup-label {
    flex: 1;
}

.nav-chevron-nested {
    font-size: var(--nav-submenu-icon-font-size);
    transition: transform 0.15s ease;
}

.nav-subgroup.is-open .nav-chevron-nested {
    transform: rotate(90deg);
}

.nav-submenu-nested {
    list-style: none;
    margin: 0 4px 4px;
    padding: 0 0 4px;
    display: none;
}

.nav-subgroup.is-open > .nav-submenu-nested {
    display: block;
}

.nav-nested-heading {
    display: block;
    padding: 10px 10px 4px 48px;
    margin: 4px 4px 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    opacity: 0.9;
}

.nav-submenu-nested a {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    padding: 7px 10px 7px 28px;
    margin: 1px 4px;
    border-radius: 6px;
    color: var(--sidebar-muted);
    text-decoration: none;
    font-size: var(--nav-submenu-font-size);
    font-weight: 700;
    line-height: 1.35;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-submenu-nested a:hover,
.nav-submenu-nested a.is-active {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-submenu-nested a.is-active {
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Third-level nav (e.g. Reports → Management reports) */
.nav-submenu-nested .nav-subgroup-toggle {
    padding-left: 28px;
}

.nav-submenu-nested .nav-submenu-nested a {
    padding-left: 44px;
}

/* Sidebar submenu typography — all levels (Trading, Accounting, Payroll, etc.) */
.sidebar-nav .nav-submenu a,
.sidebar-nav .nav-submenu-nested a,
.sidebar-nav .nav-subgroup-toggle,
.sidebar-nav .nav-submenu-nested .nav-subgroup-toggle,
body.sidebar-collapsed .nav-group.is-open .nav-submenu a {
    font-size: var(--nav-submenu-font-size);
}

.sidebar-nav .nav-submenu-icon,
.sidebar-nav .nav-subgroup-toggle .nav-submenu-icon {
    font-size: var(--nav-submenu-icon-font-size);
}

.sidebar-foot {
    padding: 10px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-sm);
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 14px;
}

.sidebar-collapse-btn:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-chevron {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 12px 8px;
}

body.sidebar-collapsed .brand-logo-link {
    width: 40px;
    padding: 3px;
    overflow: hidden;
}

body.sidebar-collapsed .brand-logo {
    max-height: 34px;
    width: 110px;
    max-width: none;
    object-fit: cover;
    object-position: left center;
}

body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .nav-group-toggle {
    justify-content: center;
    padding: 12px 8px;
}

body.sidebar-collapsed .app-shell {
    margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .nav-submenu {
    display: none !important;
}

body.sidebar-collapsed .nav-group.is-open .nav-submenu {
    position: absolute;
    left: calc(100% + 4px);
    top: 0;
    display: block !important;
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px;
    margin: 0;
    background: var(--sidebar-bg-2);
    border: 1px solid var(--sidebar-border);
    border-left: 2px solid var(--accent);
    box-shadow: 8px 12px 28px rgba(0, 0, 0, 0.4);
    z-index: 300;
}

body.sidebar-collapsed .nav-submenu a {
    padding: 8px 10px;
    margin: 1px 0;
}

@media (min-width: 901px) {
    body.sidebar-hidden .app-sidebar {
        display: none;
        transform: translateX(-100%);
        visibility: hidden;
        pointer-events: none;
    }

    body.sidebar-hidden .app-shell {
        margin-left: 0 !important;
        width: 100%;
        max-width: none;
        min-height: 100dvh;
    }

    body.sidebar-hidden main.app-content.content {
        width: 100%;
        max-width: none;
        min-height: calc(100dvh - var(--topbar-h, 48px));
    }
}

.app-shell {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    min-height: var(--topbar-main-h);
    background: var(--topbar-bg);
    color: var(--topbar-text);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid #2a3344;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 0;
}

.topbar-context {
    font-size: 12px;
    color: var(--sidebar-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
}

.topbar-user {
    color: var(--accent-hover);
    font-weight: 600;
}

.topbar-link {
    color: var(--topbar-text);
    text-decoration: none;
    opacity: 0.85;
}

.topbar-link:hover {
    opacity: 1;
    color: var(--accent-hover);
}

.topbar-link-logout {
    padding: 4px 10px;
    border: 1px solid #3d4a5e;
    border-radius: 6px;
}

.topbar-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
}

.topbar-logout-form button.topbar-link {
    font: inherit;
    cursor: pointer;
    background: transparent;
}

.app-content,
.content {
    flex: 1;
    padding: 20px 24px 32px;
    margin-left: 0;
}

/* Legacy aliases — old pages still use .topbar / .sidebar in rare cases */
.topbar {
    display: none;
}

.sidebar {
    display: none;
}

/* ===== Page & dashboard ===== */

.page-header {
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: #1a2332;
}

.page-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.dash-card .dash-card-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a7020;
    margin-bottom: 6px;
}

.dash-card p {
    margin: 0 0 10px;
    color: var(--text-muted);
    line-height: 1.45;
}

.dash-link {
    color: #1e4a7a;
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.dash-link:hover {
    color: var(--accent);
}

.welcome-card p {
    margin: 0;
    line-height: 1.5;
}

/* ===== Login ===== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f1319 0%, #1a2030 45%, #12161f 100%);
    padding: 24px;
}

.login-panel {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    max-width: 1000px;
    width: 100%;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a3344;
}

.login-brand {
    padding: 40px 32px;
    background:
        radial-gradient(circle at 20% 0%, rgba(201, 162, 39, 0.10) 0%, transparent 55%),
        linear-gradient(160deg, #1a2233 0%, #0f1319 100%);
    color: #e8edf4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 22px;
}

.brand-logo-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f7 100%);
    border-radius: 12px;
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.42),
        0 2px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}

.brand-logo-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 55%);
    pointer-events: none;
}

.login-software-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 480px;
    max-height: 180px;
    position: relative;
    z-index: 1;
    /* Subtle drop shadow inside the card for extra depth */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

.brand-tagline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    text-align: center;
}

.login-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    background: linear-gradient(135deg, #ffe082 0%, #ffd54f 35%, #ffc107 65%, #ffb300 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}

.login-brand p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    background: linear-gradient(135deg, #ffe082 0%, #ffd54f 50%, #ffc107 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: 0.92;
}

.login-box {
    padding: 36px 32px;
    background: var(--bg-card);
}

.login-box h2 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1a2332;
}

.login-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 12px;
    text-align: center;
}

.login-box .input-group {
    margin-bottom: 16px;
}

.login-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.login-box input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--outline-bright);
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-sizing: border-box;
}

.password-wrap {
    display: flex;
    gap: 8px;
}

.password-wrap input {
    flex: 1;
}

.toggle-password {
    padding: 0 12px;
    border: 1px solid var(--outline-bright);
    border-radius: var(--radius-sm);
    background: #eef2f7;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
}

.btn-login {
    position: relative;
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #c9a227 0%, #a8861f 100%);
    color: #1a1408;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.btn-login:hover:not(:disabled) {
    filter: brightness(1.08);
}

.btn-login:disabled,
.btn-login[disabled] {
    cursor: progress;
    opacity: 0.78;
}

.btn-login .btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(26, 20, 8, 0.35);
    border-top-color: #1a1408;
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
}

.btn-login.is-busy .btn-spinner {
    display: inline-block;
}

.btn-login.is-busy .btn-label {
    opacity: 0.85;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.01em;
    opacity: 0.9;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.login-credit:hover {
    opacity: 1;
    color: var(--accent);
}

.login-credit img {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.login-credit strong {
    color: var(--text);
    font-weight: 600;
}

.login-copyright {
    color: var(--text-muted);
    font-size: 10px;
}

.login-scube-icon {
    display: flex;
    justify-content: center;
    margin: 18px 0 6px;
}

.scube-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f7 100%);
    box-shadow:
        0 6px 18px rgba(15, 19, 25, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(15, 19, 25, 0.05);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
    overflow: hidden;
}

.scube-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 50%);
    pointer-events: none;
}

.scube-badge:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 24px rgba(15, 19, 25, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(15, 19, 25, 0.06);
}

.scube-badge-img {
    width: 38px;
    height: 38px;
    display: block;
    position: relative;
    z-index: 1;
}

/* Theme-aware icon swap: respects data-app-theme (app-forced) not OS preference */
.scube-badge-img.scube-light { display: block; }
.scube-badge-img.scube-dark  { display: none; }
html[data-app-theme="dark"] .scube-badge-img.scube-light { display: none; }
html[data-app-theme="dark"] .scube-badge-img.scube-dark  { display: block; }

/* Dark mode: keep the white card so the orange "S" stays visible,
   but tune the shadow for the dark surface */
html[data-app-theme="dark"] .scube-badge {
    background: linear-gradient(135deg, #ffffff 0%, #e9ecf2 100%);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

html[data-app-theme="dark"] .scube-badge:hover {
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

@media (max-width: 700px) {
    .login-panel {
        grid-template-columns: 1fr;
    }
    .login-brand {
        padding: 32px 24px;
        align-items: center;
        text-align: center;
        gap: 18px;
    }
    .brand-logo-card {
        padding: 8px 12px;
        border-radius: 10px;
    }
    .login-software-logo {
        max-width: 280px;
        max-height: 104px;
    }
    .brand-tagline {
        align-items: center;
    }
}

/* ===== Forms & tables (app pages) ===== */

td.num,
.num {
    text-align: right !important;
}

label {
    text-transform: capitalize;
}

.card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--outline-bright);
    box-shadow: var(--shadow-card);
}

.grid-container {
    border: 1px solid var(--outline-bright);
    border-radius: var(--radius);
    overflow: hidden;
    height: 220px;
    overflow-y: auto;
    background: var(--bg-input);
}

input,
select,
textarea,
button {
    font-family: 'Inter', sans-serif;
}

input,
select,
textarea {
    border: 1px solid var(--outline-bright);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-input);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #5b7cfa;
    box-shadow: 0 0 0 2px rgba(91, 124, 250, 0.15);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

table th,
table td {
    padding: 10px;
    border: 1px solid var(--grid-line-bright);
    text-align: left;
}

table th {
    background: #1e2838;
    color: #e8edf4;
}

table tr:nth-child(even) {
    background: #eef2f7;
}

table tr:hover {
    background: #e4ebf5;
}

/* ===== Grid table (Forex etc.) ===== */

#grid {
    table-layout: fixed;
    width: 100%;
}

@media (min-width: 901px) {
    #grid {
        min-width: 1000px;
    }
}

#grid th:nth-child(1) { width: 90px; }
#grid th:nth-child(2) { width: 100px; }
#grid th:nth-child(3) { width: 130px; }
#grid th:nth-child(4) { width: 120px; }
#grid th:nth-child(5) { width: 130px; }
#grid th:nth-child(6) { width: 120px; }
#grid th:nth-child(7) { width: 80px; }
#grid th:nth-child(8) { width: 50px; }
#grid th:nth-child(9) { width: 60px; }

#grid th {
    text-align: center;
    vertical-align: middle;
}

#grid td:nth-child(1),
#grid td:nth-child(2) {
    text-align: center;
}

#grid td:nth-child(3),
#grid td:nth-child(4),
#grid td:nth-child(5),
#grid td:nth-child(6),
#grid td:nth-child(7),
#grid td:nth-child(8) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#grid td:nth-child(9) {
    text-align: center;
}

.btn {
    background: #2d4a6f;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
}

.btn:hover {
    background: #3a5d85;
}

.btn-danger {
    background: #b91c1c;
}

.btn-danger:hover {
    background: #991b1b;
}

@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    body.sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
    }

    .app-shell {
        margin-left: 0;
    }
}
