﻿/* ============================================================
   HIMS — Global Styles
   Bootstrap 5 base + custom sidebar layout
   ============================================================ */

/* ── Variables ── */
:root {
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --sidebar-bg: linear-gradient(180deg, #1b2e4b 0%, #15395e 50%, #0f4c82 100%);
    --sidebar-bg-flat: #1b2e4b;
    --sidebar-hover-bg: rgba(255,255,255,.10);
    --sidebar-active-bg: rgba(13,110,253,.85);
    --sidebar-text: rgba(255,255,255,.80);
    --sidebar-text-muted: rgba(255,255,255,.45);
    --topbar-bg: #ffffff;
    --topbar-text: #1b2e4b;
    --topbar-border: rgba(27,46,75,.08);
}

/* ── Reset / Base ── */
html, body {
    height: 100%;
    font-size: 16px;
}

body.hims-app {
    font-family: 'Sarabun', 'Segoe UI', sans-serif;
    background: #f4f6f9;
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ── Top Navbar ── */
.hims-topbar {
    height: var(--topbar-height);
    z-index: 1030;
    background: var(--topbar-bg) !important;
    border-bottom: 1px solid var(--topbar-border);
    box-shadow: 0 1px 6px rgba(27,46,75,.06);
}

/* ── Layout wrapper ── */
.hims-wrapper {
    display: flex;
    padding-top: var(--topbar-height);
    min-height: 100vh;
}

/* ── Sidebar ── */
.hims-sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--topbar-height));
    background: var(--sidebar-bg);
    background-color: var(--sidebar-bg-flat);
    flex-shrink: 0;
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    transition: transform .25s ease;
    z-index: 1020;
}

.hims-sidebar-brand {
    border-bottom: 1px solid rgba(255,255,255,.12);
    min-height: 52px;
}

.hims-sidebar-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

/* ── Nav links ── */
.hims-nav-link {
    color: var(--sidebar-text) !important;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .9375rem;
    transition: background .15s, color .15s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.hims-nav-link:hover  { background: var(--sidebar-hover-bg); color: #fff !important; }
.hims-nav-link.active { background: var(--sidebar-active-bg) !important; color: #fff !important; font-weight: 600; }

.hims-nav-group {
    color: var(--sidebar-text) !important;
    background: none;
    border: none;
    border-radius: 6px;
    padding: .5rem .75rem;
    font-size: .9375rem;
    display: flex;
    align-items: center;
    transition: background .15s;
    cursor: pointer;
}

.hims-nav-group:hover { background: var(--sidebar-hover-bg); color: #fff !important; }

.hims-chevron {
    transition: transform .2s;
    font-size: .75rem;
}

.hims-nav-group:not(.collapsed) .hims-chevron {
    transform: rotate(180deg);
}

.hims-sidebar .collapse .nav {
    border-left: 1px solid rgba(255,255,255,.12);
    margin-left: .5rem;
}

/* ── Main content ── */
.hims-main {
    flex: 1 1 0;
    min-width: 0;
    padding: 1.5rem;
}

/* ── Sidebar backdrop (mobile) ── */
.hims-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1015;
}

.hims-sidebar-backdrop.show { display: block; }

/* ── Mobile ── */
@media (max-width: 991.98px) {
    .hims-sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        height: calc(100vh - var(--topbar-height));
        transform: translateX(-100%);
        z-index: 1025;
    }

    .hims-sidebar.show { transform: translateX(0); }
    .hims-main { padding: 1rem; }
}

/* ── Login page ── */
body.hims-login-bg {
    background: linear-gradient(135deg, #1b2e4b 0%, #1565c0 50%, #0d6efd 100%);
    margin-bottom: 0;
}

.hims-login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
}

.hims-login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #f0f4ff;
    border-radius: 16px;
}

/* ── Cards & Tables ── */
.card { border-radius: 10px; border: 1px solid rgba(0,0,0,.07); }
.table th { font-weight: 600; font-size: .9rem; background: #f8f9fa; }

/* ── Page title ── */
.hims-page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1b2e4b;
    margin-bottom: 1.25rem;
}

/* ── Status badges ── */
.badge-draft        { background: #6c757d; }
.badge-submitted    { background: #0dcaf0; color: #000; }
.badge-approved     { background: #198754; }
.badge-partially    { background: #fd7e14; }
.badge-fully-issued { background: #0d6efd; }
.badge-rejected     { background: #dc3545; }
.badge-cancelled    { background: #adb5bd; color: #000; }
