:root {
    color-scheme: light;
    --ink: #1d2b37;
    --muted: #74818a;
    --line: #e2e8e7;
    --paper: #fff;
    --canvas: #f3f6f4;
    --navy: #143746;
    --green: #2a8e68;
    --green-dark: #1e6e51;
    --red: #b94a45;
    --font-body: "DM Sans", sans-serif;
    --font-display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: var(--font-body); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-view { display: grid; min-height: 100vh; min-height: 100svh; grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr); background: #f7f9f7; }
.auth-story { position: relative; display: flex; min-height: 100vh; min-height: 100svh; flex-direction: column; justify-content: space-between; gap: 35px; padding: 36px clamp(35px, 6vw, 88px) 28px; overflow: hidden; color: #fff; background: #143746; }
.auth-story-image, .auth-story-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-story-image { object-fit: cover; object-position: center 45%; }
.auth-story-shade { background: linear-gradient(90deg, rgba(12, 39, 49, .88), rgba(15, 49, 58, .62) 62%, rgba(15, 49, 58, .38)); }
.auth-story > :not(.auth-story-image):not(.auth-story-shade) { position: relative; z-index: 1; }
.auth-brand, .sidebar-brand { display: inline-flex; align-items: center; gap: 13px; color: #fff; font-family: var(--font-display); font-size: 15px; font-weight: 700; text-decoration: none; }
.auth-brand { align-self: start; color: #f7fbf8; }
.auth-brand strong, .sidebar-brand strong { font-weight: 800; }
.auth-brand small, .sidebar-brand small { display: block; margin-top: 3px; color: #a9c2b9; font-family: var(--font-body); font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.brand-mark { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 14px; }
.brand-mark span { margin-left: 1px; color: #8bd1a9; }
.auth-story-copy { max-width: 610px; margin-block: auto; padding-block: 60px; }
.auth-story-eyebrow { color: #a7dfbd; font-size: 10px; font-weight: 800; }
.auth-story-copy h2 { margin: 20px 0 15px; color: #fff; font-family: var(--font-display); font-size: 46px; font-weight: 800; line-height: 1.13; }
.auth-story-copy p { max-width: 470px; margin: 0; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.75; }
.auth-story-footer { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.8); font-size: 11px; }
.auth-story-footer i { color: #8bd1a9; }
.auth-form-area { display: grid; min-width: 0; place-items: center; padding: 54px clamp(36px, 6vw, 96px); background: #f7f9f7; }
.auth-panel { width: 100%; max-width: 430px; padding: 0; animation: arrive .35s ease both; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.auth-panel h1, .page-heading h1 { margin: 13px 0 9px; color: var(--navy); font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1.2; }
.auth-panel > p, .page-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.form-stack { display: grid; gap: 19px; margin-top: 34px; }
.form-stack label, .form-grid label { display: grid; gap: 8px; color: #354752; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #dce4e1; border-radius: 4px; outline: none; color: var(--ink); background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
input, select { height: 48px; padding: 0 13px; }
textarea { padding: 12px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: #3b9b76; box-shadow: 0 0 0 3px rgba(42,142,104,.12); }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; border-color: var(--green); background: var(--green); }
.button-primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button-quiet { color: #53636b; border-color: var(--line); background: #fff; }
.button-quiet:hover { background: #f5f8f6; }
.form-error { margin: 0; color: var(--red); font-size: 12px; line-height: 1.55; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; color: #62726e; font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--green-dark); }
@media (max-width: 900px) {
    .auth-view { grid-template-columns: minmax(0, .95fr) minmax(390px, 1.05fr); }
    .auth-story { padding-inline: 38px; }
    .auth-story-copy h2 { font-size: 36px; }
    .auth-form-area { padding-inline: 36px; }
}

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 25px 17px 18px; color: #eef5f1; background: var(--navy); }
.sidebar-brand { padding: 0 8px 27px; border-bottom: 1px solid rgba(255,255,255,.11); font-size: 13px; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; }
.sidebar-label { margin: 27px 9px 11px; color: #8da7a2; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; min-height: 43px; align-items: center; gap: 13px; padding: 0 12px; border: 0; border-left: 2px solid transparent; color: #c2d0cd; background: transparent; text-align: left; font-size: 12px; font-weight: 600; }
.nav-item i { width: 17px; color: #9fb6af; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { border-left-color: #76c79f; color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active i { color: #81d1a7; }
.sidebar-bottom { display: grid; gap: 18px; margin-top: auto; }
.view-site, .logout-button { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; color: #c3d1cd; background: none; text-align: left; font-size: 11px; text-decoration: none; }
.view-site:hover, .logout-button:hover { color: #fff; }
.admin-identity { display: flex; align-items: center; gap: 10px; padding: 13px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.identity-avatar { display: grid; width: 33px; height: 33px; place-items: center; color: #d7eee2; background: #2a5b59; }
.admin-identity strong, .admin-identity small { display: block; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity strong { color: #f5faf7; font-size: 11px; }
.admin-identity small { margin-top: 4px; color: #91aaa2; font-size: 10px; }
.main-area { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; height: 67px; align-items: center; gap: 13px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.topbar > div { display: grid; gap: 3px; }
.topbar-kicker { color: #88958e; font-size: 9px; font-weight: 800; letter-spacing: 1px; }
.topbar strong { color: var(--navy); font-size: 12px; }
.online-status { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #5e7268; font-size: 10px; }
.online-status i { width: 7px; height: 7px; border-radius: 50%; background: #40a879; }
.menu-button { display: none; width: 34px; height: 34px; border: 1px solid var(--line); color: var(--navy); background: #fff; }
.page-content { width: min(1220px, 100%); margin: 0 auto; padding: 39px 38px 55px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 27px; }
.page-heading h1 { margin: 8px 0 6px; font-size: 27px; }
.page-heading h1 span { color: var(--green); }
.page-heading p { font-size: 12px; }
.notice { margin: 0 0 20px; padding: 12px 15px; border-left: 3px solid var(--green); color: #286347; background: #eaf5ee; font-size: 12px; line-height: 1.55; }
.notice.is-error { border-color: var(--red); color: #98403c; background: #fff0ef; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat-panel { display: grid; grid-template-columns: 42px 1fr; align-items: center; column-gap: 13px; min-height: 116px; padding: 17px 19px; border: 1px solid var(--line); background: var(--paper); }
.stat-icon { display: grid; width: 40px; height: 40px; grid-row: span 3; place-items: center; }
.stat-icon.green { color: #27845f; background: #e9f4ed; }
.stat-icon.blue { color: #3d7990; background: #eaf3f5; }
.stat-icon.orange { color: #aa7740; background: #f8f0e5; }
.stat-label { color: #74817b; font-size: 10px; font-weight: 600; }
.stat-panel > strong { color: var(--navy); font-family: var(--font-display); font-size: 23px; line-height: 1.15; }
.stat-panel > strong.account-state { font-size: 17px; }
.stat-panel > small { color: #929d97; font-size: 10px; }
.home-lower-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 16px; }
.category-breakdown { display: grid; gap: 18px; padding: 21px 20px 23px; }
.category-row { display: grid; gap: 8px; }
.category-row-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #56655e; font-size: 11px; }
.category-row-label strong { color: var(--navy); font-size: 11px; }
.category-track { height: 6px; overflow: hidden; background: #edf1ee; }
.category-fill { display: block; height: 100%; min-width: 3px; background: #2a8e68; transition: width .3s ease; }
.category-laboratory { background: #4a8292; }
.category-consumables { background: #c28a4c; }
.category-diagnostic { background: #69836f; }
.quick-actions { display: grid; padding: 4px 17px; }
.quick-action { display: grid; grid-template-columns: 35px minmax(0, 1fr) 18px; align-items: center; gap: 11px; min-height: 63px; padding: 8px 0; border: 0; border-bottom: 1px solid #edf1ee; color: #354a48; background: transparent; text-align: left; }
.quick-action:last-child { border-bottom: 0; }
.quick-action strong { font-size: 11px; font-weight: 700; }
.quick-action:hover strong, .quick-action:hover .quick-action-arrow { color: var(--green-dark); }
.quick-action-icon { display: grid; width: 34px; height: 34px; place-items: center; }
.quick-action-icon.green { color: #27845f; background: #e9f4ed; }
.quick-action-icon.blue { color: #3d7990; background: #eaf3f5; }
.quick-action-icon.orange { color: #aa7740; background: #f8f0e5; }
.quick-action-arrow { color: #91a098; font-size: 10px; }
.content-panel { min-width: 0; border: 1px solid var(--line); background: var(--paper); }
.panel-heading { display: flex; min-height: 75px; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 19px; border-bottom: 1px solid #edf0ee; }
.panel-heading h2 { margin: 0 0 5px; color: var(--navy); font-family: var(--font-display); font-size: 14px; font-weight: 800; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.text-button { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0 6px 8px; border: 0; color: var(--green-dark); background: none; font-size: 11px; font-weight: 700; white-space: nowrap; }
.panel-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--green); background: #eaf4ee; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 15px; color: #87938d; background: #fafbfa; font-size: 9px; font-weight: 800; letter-spacing: .45px; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 15px; border-top: 1px solid #eff2f0; color: #56655e; font-size: 11px; white-space: nowrap; }
.table-product { display: flex; align-items: center; gap: 10px; }
.table-product > span:last-child { display: grid; gap: 4px; }
.table-product strong { max-width: 230px; overflow: hidden; color: #263c43; font-size: 11px; text-overflow: ellipsis; }
.table-product small { color: #97a39d; font-size: 9px; }
.product-thumb { display: grid; width: 42px; height: 42px; flex-shrink: 0; place-items: center; overflow: hidden; color: #55836d; background: #edf4ef; }
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-thumb-large { width: 62px; height: 54px; border: 1px solid #e8eeea; background: #f7faf8; }
.inventory-thumb { width: 48px; height: 44px; }
.catalogue-toolbar { display: flex; justify-content: flex-end; padding: 14px 18px; border-bottom: 1px solid #edf0ee; }
.catalogue-search { position: relative; display: block; width: min(320px, 100%); }
.catalogue-search i { position: absolute; top: 50%; left: 12px; color: #829089; transform: translateY(-50%); }
.catalogue-search input { height: 39px; padding-left: 35px; font-size: 11px; }
.catalogue-table td { white-space: normal; }
.catalogue-table td:nth-child(2), .catalogue-table td:nth-child(3), .catalogue-table td:nth-child(4), .catalogue-table td:nth-child(5) { white-space: nowrap; }
.price-cell { color: #253f42; font-weight: 700; }
.status-pill { display: inline-block; padding: 5px 8px; color: #347653; background: #edf6ef; font-size: 9px; font-weight: 700; }
.row-actions, .inventory-actions { display: inline-flex; align-items: center; gap: 5px; }
.icon-button { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid transparent; color: #5c7569; background: transparent; }
.icon-button:hover { border-color: #dce7df; background: #f3f7f4; }
.icon-button.danger { color: #b45852; }
.icon-button.danger:hover { border-color: #f0d7d4; background: #fff4f3; }
.table-empty { padding: 38px 20px; color: var(--muted); text-align: center; }
.table-empty > i { color: #8eaa9b; font-size: 23px; }
.table-empty p { margin: 10px 0 17px; font-size: 12px; }
.management-layout { display: grid; grid-template-columns: minmax(330px, .94fr) minmax(350px, 1.06fr); align-items: start; gap: 17px; }
.product-form-panel .panel-heading, .account-panel .panel-heading { padding-inline: 23px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 13px; padding: 21px 23px 23px; }
.form-grid label { font-size: 11px; }
.form-grid input, .form-grid select { height: 41px; font-size: 11px; }
.form-grid textarea { font-size: 11px; }
.image-upload-field input[type="file"] { height: auto; min-height: 43px; padding: 6px; border-style: dashed; background: #fbfcfb; font-size: 10px; }
.image-upload-field input[type="file"]::file-selector-button { min-height: 29px; margin-right: 10px; padding: 0 10px; border: 1px solid #dce7df; border-radius: 3px; color: #355d4a; background: #edf5ef; font: inherit; font-weight: 700; cursor: pointer; }
.image-upload-field small { color: #89968f; font-size: 10px; font-weight: 400; }
.image-preview { display: flex; min-height: 155px; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #e4ebe6; background: #f7faf8; }
.image-preview img { display: block; width: 100%; max-height: 230px; object-fit: contain; }
.image-preview span { display: flex; align-items: center; gap: 9px; color: #84948a; font-size: 11px; }
.image-preview span i { font-size: 19px; }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.form-actions .button { min-height: 39px; }
.inventory-panel .panel-heading { min-height: 75px; }
.inventory-list { display: grid; }
.inventory-item { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px 15px; border-bottom: 1px solid #edf1ee; }
.inventory-item:last-child { border-bottom: 0; }
.inventory-symbol { display: grid; width: 34px; height: 34px; flex-shrink: 0; place-items: center; color: #57816d; background: #eff5f0; }
.inventory-copy { display: grid; min-width: 0; flex: 1; gap: 4px; }
.inventory-copy strong { overflow: hidden; color: #2a4145; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-copy span { overflow: hidden; color: #8a9791; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.inventory-copy b { color: #35654f; font-size: 10px; }
.inventory-actions { flex-shrink: 0; }
.account-panel { max-width: 670px; }
.account-form { max-width: 480px; }
.field-divider { display: flex; align-items: center; gap: 12px; margin-top: 3px; padding-top: 16px; border-top: 1px solid #edf1ee; color: #385249; font-size: 11px; font-weight: 700; }
.field-divider small { color: #89968f; font-size: 10px; font-weight: 400; }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .page-content { padding-inline: 25px; }
    .topbar { padding-inline: 25px; }
    .management-layout { grid-template-columns: 1fr; }
    .home-lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .auth-view { grid-template-columns: 1fr; }
    .auth-story { min-height: 270px; gap: 30px; padding: 22px 24px 25px; }
    .auth-story-copy { margin-block: auto 0; padding-block: 12px 0; }
    .auth-story-copy h2 { margin: 11px 0 8px; font-size: 27px; }
    .auth-story-copy p { max-width: 440px; font-size: 12px; }
    .auth-story-footer { display: none; }
    .auth-form-area { place-items: start center; padding: 36px 23px 48px; }
    .auth-panel { max-width: 470px; justify-self: center; }
    .auth-panel h1 { font-size: 27px; }
    .app-shell { display: block; }
    .sidebar { position: fixed; z-index: 8; width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 35px rgba(13,40,47,.2); }
    .sidebar.sidebar-open { transform: translateX(0); }
    .topbar { height: 59px; padding-inline: 15px; }
    .menu-button { display: grid; place-items: center; }
    .page-content { padding: 27px 15px 40px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
    .page-heading h1 { font-size: 23px; }
    .stat-grid { grid-template-columns: 1fr; gap: 9px; }
    .stat-panel { min-height: 91px; }
    .home-lower-grid { grid-template-columns: minmax(0, 1fr); }
    .panel-heading { padding-inline: 14px; }
    .management-layout { grid-template-columns: minmax(0, 1fr); }
    .form-grid { padding-inline: 15px; }
    .account-form { grid-template-columns: 1fr; }
    .field-divider { align-items: flex-start; flex-direction: column; gap: 5px; }
    th, td { padding-inline: 10px; }
    .table-product strong { max-width: 155px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}