:root {
    --ink: #081a2c;
    --muted: #607386;
    --line: #d8e3ed;
    --surface: #fff;
    --canvas: #f4f7fa;
    --brand: #071527;
    --brand-2: #0877d1;
    --brand-soft: #e9f4ff;
    --accent: #63d8ff;
    --danger: #c7384f;
    --danger-soft: #fff0f3;
    --warning: #a96500;
    --warning-soft: #fff6df;
    --success: #087a5b;
    --success-soft: #e9f8f3;
    --blue: #0877d1;
    --shadow: 0 18px 50px rgba(7, 21, 39, .08);
    --radius: 20px;
    --sidebar: 0px;
    font-family: Manrope, "Segoe UI", Arial, sans-serif;
}

html { background: var(--canvas); }
body { color: var(--ink); background: var(--canvas); font-size: 15px; }
body.app-page { background: radial-gradient(circle at 8% 5%, rgba(8,119,209,.08), transparent 25%), radial-gradient(circle at 94% 12%, rgba(99,216,255,.08), transparent 22%), var(--canvas); }
a { color: var(--brand-2); }
a:hover { color: #005ba6; }

input, select, textarea { min-height: 50px; border-color: #cbd9e6; border-radius: 12px; padding: 11px 14px; font-size: 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(8,119,209,.12); }
input::placeholder, textarea::placeholder { color: #91a2b2; }
label > span:first-child, fieldset > legend { margin-bottom: 8px; color: #30475d; font-size: 13px; font-weight: 800; }
label > small { margin-top: 7px; font-size: 12px; line-height: 1.45; }

.sidebar { display: none !important; }
.app-shell { min-height: calc(100vh - 82px); margin-left: 0; }
.app-header { position: sticky; top: 0; z-index: 40; color: #fff; background: rgba(7,21,39,.97); box-shadow: 0 10px 30px rgba(7,21,39,.18); backdrop-filter: blur(18px); }
.app-header::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; content: ""; background: linear-gradient(90deg, transparent, #0877d1 28%, #63d8ff 55%, transparent); opacity: .8; }
.app-header-inner { width: min(1580px, 100%); min-height: 82px; display: flex; align-items: center; gap: 22px; margin: 0 auto; padding: 12px 28px; }
.app-logo { position: relative; display: flex; flex: 0 0 auto; align-items: center; padding: 3px 10px; border: 1px solid rgba(255,255,255,.42); border-radius: 15px; color: #fff; background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(238,248,255,.72)); box-shadow: 0 10px 32px rgba(4,15,29,.14); backdrop-filter: blur(14px) saturate(135%); }
.app-logo:hover { color: #fff; }
.app-logo::after { position: absolute; right: 9px; bottom: 5px; left: 9px; height: 1px; content: ""; background: linear-gradient(90deg,transparent,rgba(8,119,209,.48),transparent); opacity: .7; }
.app-logo img { display: block; width: 154px; height: 50px; object-fit: contain; }
.top-nav { display: flex; min-width: 0; align-items: center; gap: 4px; margin-left: auto; }
.top-nav .nav-link { display: flex; min-height: 42px; align-items: center; gap: 7px; padding: 0 11px; border-radius: 999px; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 800; white-space: nowrap; }
.top-nav .nav-link span { width: auto; color: #72cdfa; font-size: 15px; }
.top-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.top-nav .nav-link.is-active { color: #fff; background: #0877d1; box-shadow: 0 8px 20px rgba(8,119,209,.3); }
.top-nav .nav-link.is-active span { color: #fff; }
.header-account { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding-left: 13px; border-left: 1px solid rgba(255,255,255,.13); }
.header-user { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 12px; color: #fff; }
.header-user:hover { color: #fff; background: rgba(255,255,255,.07); }
.header-user > span:last-child { display: flex; max-width: 150px; min-width: 0; flex-direction: column; }
.header-user strong, .header-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-user strong { font-size: 12px; }
.header-user small { margin-top: 2px; color: rgba(255,255,255,.55); font-size: 10px; }
.avatar { color: #fff; background: linear-gradient(145deg, #0877d1, #115ca4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.header-logout { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: rgba(255,255,255,.68); background: transparent; font-size: 17px; }
.header-logout:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.mobile-header, .bottom-nav { display: none; }

.main-content { width: min(1540px, 100%); margin: 0 auto; padding: 34px 32px 76px; }
.page-heading { align-items: center; margin-bottom: 24px; }
.page-heading h1 { margin: 4px 0 7px; color: var(--ink); font-family: Manrope, "Segoe UI", Arial, sans-serif; font-size: clamp(30px, 3vw, 42px); font-weight: 800; line-height: 1.04; letter-spacing: -.04em; }
.page-heading p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.eyebrow { color: var(--brand-2) !important; font-size: 11px !important; letter-spacing: .13em; }
.back-link { display: inline-flex; align-items: center; min-height: 36px; margin-bottom: 12px; font-size: 13px; font-weight: 800; }
.heading-actions { flex-wrap: wrap; justify-content: flex-end; }

.button { min-height: 46px; border-radius: 999px; padding: 10px 18px; font-size: 13px; font-weight: 800; }
.button-primary { background: linear-gradient(135deg, #0783df, #0872c7); box-shadow: 0 10px 24px rgba(8,119,209,.23); }
.button-primary:hover { background: linear-gradient(135deg, #0575c9, #075fa8); }
.button-secondary { color: var(--brand); border-color: #bfd0df; background: #fff; }
.button-secondary:hover { color: var(--brand-2); border-color: #8db8d9; background: #f3f9ff; }
.button-ghost { border-color: #d3dfea; background: #fff; }
.button-small { min-height: 38px; font-size: 12px; }
.button-large { min-height: 54px; font-size: 14px; }

.panel { border-color: rgba(200,215,228,.85); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { padding: 23px 25px 17px; }
.panel-heading h2 { font-size: 18px; font-weight: 800; letter-spacing: -.015em; }
.panel-heading p, .panel-heading > a { font-size: 12px; }
.panel-heading > a { font-weight: 800; }
.app-shell small { font-size: 12px; }

.stat-grid { gap: 14px; }
.stat-card { position: relative; min-height: 118px; overflow: hidden; border-color: #d4e0eb; border-radius: 18px; padding: 21px; box-shadow: 0 12px 32px rgba(7,21,39,.055); }
.stat-card::after { position: absolute; top: 0; right: 0; width: 70px; height: 70px; border-radius: 0 0 0 70px; content: ""; background: linear-gradient(145deg, rgba(99,216,255,.15), rgba(8,119,209,.03)); }
.stat-card:hover { border-color: #8ebcdd; box-shadow: 0 16px 38px rgba(7,21,39,.09); transform: translateY(-2px); }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; }
.stat-teal, .stat-blue { color: #0877d1; background: #e7f4ff; }
.stat-card small { color: #607386; font-size: 12px; font-weight: 700; }
.stat-card strong { margin-top: 6px; font-family: Manrope, "Segoe UI", Arial, sans-serif; font-size: 29px; font-weight: 800; letter-spacing: -.04em; }
.dashboard-grid { gap: 18px; }
.dashboard-plan-stats small { font-size: 11px; }
.dashboard-plan-stats > span { border: 1px solid rgba(8,119,209,.08); border-radius: 12px; }
.activity-list, .low-stock-list { padding-bottom: 16px; }
.activity-row { padding-block: 15px; }
.activity-main strong, .low-stock-list strong { font-size: 13px; }
.activity-main span, .activity-value span, .low-stock-list span { font-size: 11px; }

.filter-bar { gap: 11px; padding: 15px; border-color: #d3e0eb; border-radius: 17px; background: rgba(255,255,255,.9); box-shadow: 0 10px 28px rgba(7,21,39,.04); }
.search-field > span { color: var(--brand-2); }
.autocomplete-list, .search-field > .autocomplete-list { border-color: #b9d3e7; border-radius: 15px; box-shadow: 0 20px 48px rgba(7,21,39,.18); }
.autocomplete-option { min-height: 62px; border-radius: 11px; }
.autocomplete-option:hover, .autocomplete-option.is-active { background: #edf7ff; }
.autocomplete-details strong { font-size: 13px; }
.autocomplete-details small, .autocomplete-balance small { font-size: 11px; }
.autocomplete-balance strong { font-size: 12px; }

.table-panel { border-radius: 20px; }
.data-table { font-size: 14px; }
.data-table th { padding: 15px 18px; color: #506579; background: #f2f6fa; font-size: 11px; letter-spacing: .045em; }
.data-table td { padding: 16px 18px; border-top-color: #e3ebf2; color: #30475d; }
.data-table tbody tr:hover { background: #f8fbfe; }
.table-subline { max-width: 300px; font-size: 11px; }
.item-cell strong { font-size: 13px; }
.item-cell > img, .item-image-placeholder { width: 48px; height: 48px; border-radius: 12px; }
.stock-breakdown { font-size: 11px; }
.badge { min-height: 27px; padding: 5px 10px; font-size: 11px; }
.icon-button { width: 38px; height: 38px; border-radius: 11px; }

.inventory-hierarchy > summary { padding: 19px 21px; }
.inventory-hierarchy > summary strong { font-size: 15px; }
.inventory-hierarchy > summary b { color: #0877d1; background: #e7f4ff; }
.hierarchy-toolbar { background: #f7fafc; }
.hierarchy-brand { border-color: #d6e2ec; background: #fff; }
.hierarchy-brand > summary strong { color: var(--ink); }
.hierarchy-size-table { border-color: #d2dfeb; }
.hierarchy-size-head { color: #52687c; border-color: #d2dfeb; background: #eef4f8; font-size: 11px; }
.hierarchy-size { padding-block: 12px; }
.hierarchy-size:hover, .hierarchy-size.is-active { background: #eaf5ff; }
.hierarchy-size strong { color: #075fa8; }
.hierarchy-size span, .hierarchy-size small { color: #52687c; }

.form-panel { max-width: 1080px; padding: 32px; }
.form-section-heading { margin-bottom: 23px; }
.form-section-heading:not(:first-of-type) { border-top-color: #dce6ef; }
.form-section-heading > span { width: 42px; height: 42px; border-radius: 13px; color: #0877d1; background: #e7f4ff; font-size: 13px; }
.form-section-heading h2 { font-size: 19px; }
.form-section-heading p { font-size: 12px; }
.form-grid { gap: 20px; }
.form-actions { border-top-color: #dce6ef; }
.current-stock-note, .selected-item-preview, .new-item-fields, .movement-line { border-color: #d1dfeb; background: #f6f9fc; }
.selected-item-preview > div small { font-size: 11px; }
.selected-item-preview > div span { font-size: 12px; }
.operation-switch label > span { min-height: 82px; border-color: #d6e1eb; border-radius: 15px; }
.operation-switch input:checked + span { border-color: #0877d1; box-shadow: 0 0 0 3px rgba(8,119,209,.12); }
.operation-switch small, .item-source-switch > span, .item-source-switch label > span { font-size: 12px; }

.reservation-list { gap: 18px; }
.reservation-card-head { padding: 22px 22px 15px; }
.reservation-number { color: #0877d1; font-size: 11px; }
.reservation-card-head p, .reservation-meta span, .reservation-item small, .reservation-card-footer > span { font-size: 11px; }
.reservation-meta strong, .reservation-item strong, .reservation-item > b { font-size: 13px; }
.create-reservation-panel > summary strong, .create-user-panel > summary strong { font-size: 15px; }
.create-reservation-panel > summary small, .create-user-panel > summary small { font-size: 12px; }
.plan-reservation-link { font-size: 12px; }

.audit-entry { gap: 15px; }
.audit-meta time, .audit-card > p, .audit-card summary, .change-details strong { font-size: 12px; }
.user-panel { padding: 23px; }
.user-panel h2 { font-size: 16px; }
.user-panel p, .status-dot, .user-meta dt, .user-meta dd { font-size: 11px; }
.profile-card h2 { font-family: Manrope, "Segoe UI", Arial, sans-serif; font-size: 24px; font-weight: 800; }
.profile-card dt, .profile-card dd { font-size: 12px; }
.password-field button { font-size: 12px; }

.photo-tile, .photo-result-card { border-radius: 16px; }
.photo-tile > div span, .photo-tile > div small, .photo-upload-form > small, .photo-upload-preview span { font-size: 11px; }
.photo-empty p, .search-method-heading p, .photo-index-count small, .photo-search-preview small, .photo-search-note p, .result-body > p, .result-stock span { font-size: 12px; }
.photo-file-button > span { min-height: 46px; border-radius: 999px; font-size: 12px; }
.search-method-heading h2, .photo-search-dropzone h2 { font-family: Manrope, "Segoe UI", Arial, sans-serif; font-weight: 800; }
.search-method-heading > span, .camera-mark { color: #0877d1; background: #e7f4ff; }
.photo-search-dropzone { background: radial-gradient(circle at 50% 5%, rgba(8,119,209,.12), transparent 43%), #fff; }
.result-sku { color: #0877d1; font-size: 11px; }

.flash { border-radius: 14px; padding: 14px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(7,21,39,.05); }
.empty-state h2, .error-state h1 { font-family: Manrope, "Segoe UI", Arial, sans-serif; font-weight: 800; }
.empty-state p, .error-state p { font-size: 13px; }

.auth-page { background: #071527; }
.login-shell { grid-template-columns: minmax(470px, 1.08fr) minmax(430px, .92fr); }
.login-intro { position: relative; isolation: isolate; overflow: hidden; padding: 42px clamp(36px, 5vw, 78px); background: #071527; }
.login-intro::before { position: absolute; inset: 0; z-index: -2; content: ""; background: radial-gradient(circle at 78% 18%, rgba(8,119,209,.45), transparent 28%), radial-gradient(circle at 80% 72%, rgba(99,216,255,.14), transparent 26%), linear-gradient(115deg, rgba(7,21,39,.2), rgba(7,21,39,.96)), repeating-linear-gradient(90deg, transparent 0 94px, rgba(99,216,255,.06) 95px 96px), repeating-linear-gradient(0deg, transparent 0 94px, rgba(99,216,255,.05) 95px 96px); }
.login-intro::after { position: absolute; z-index: -1; right: -120px; bottom: -150px; width: 520px; height: 520px; border: 2px solid rgba(99,216,255,.22); border-radius: 50%; content: ""; box-shadow: 0 0 0 70px rgba(8,119,209,.05), 0 0 0 145px rgba(8,119,209,.035); }
.login-brand, .mobile-login-brand { position: relative; width: fit-content; align-items: center; padding: 3px 10px; border: 1px solid rgba(255,255,255,.42); border-radius: 15px; background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(238,248,255,.72)); box-shadow: 0 10px 32px rgba(4,15,29,.14); backdrop-filter: blur(14px) saturate(135%); }
.login-brand { display: flex; }
.login-brand::after, .mobile-login-brand::after { position: absolute; right: 9px; bottom: 5px; left: 9px; height: 1px; content: ""; background: linear-gradient(90deg,transparent,rgba(8,119,209,.48),transparent); opacity: .7; }
.login-brand img { display: block; width: 154px; height: 50px; object-fit: contain; }
.login-intro h1 { max-width: 760px; margin: 14px 0 22px; font-family: Manrope, "Segoe UI", Arial, sans-serif; font-size: clamp(40px, 5vw, 68px); font-weight: 800; line-height: 1.02; letter-spacing: -.055em; }
.login-intro > div > p:last-of-type { max-width: 610px; color: rgba(255,255,255,.7); font-size: 16px; }
.login-intro .eyebrow { color: #63d8ff !important; }
.login-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 640px; margin: 28px 0 0; padding: 0; list-style: none; }
.login-features li { padding: 13px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.055); backdrop-filter: blur(10px); }
.login-features strong { display: block; color: #fff; font-size: 14px; }
.login-features span { display: block; margin-top: 3px; color: rgba(255,255,255,.5); font-size: 11px; }
.login-note { color: rgba(255,255,255,.5); font-size: 12px; }
.login-panel { background: radial-gradient(circle at 20% 5%, rgba(8,119,209,.08), transparent 28%), #f4f7fa; }
.login-card { width: min(460px, 100%); padding: 44px; border-color: #d5e1eb; border-radius: 24px; box-shadow: 0 28px 80px rgba(7,21,39,.14); }
.login-card h2 { font-family: Manrope, "Segoe UI", Arial, sans-serif; font-size: 32px; font-weight: 800; letter-spacing: -.035em; }
.login-card > .muted { font-size: 13px; }
.security-note { font-size: 11px; }
.mobile-login-brand img { display: block; width: 124px; height: 42px; object-fit: contain; }

@media (max-width: 1280px) {
    .app-header-inner { gap: 12px; padding-inline: 18px; }
    .app-logo { padding: 0; border-color: transparent; background: transparent; box-shadow: none; backdrop-filter: none; }
    .app-logo::after { opacity: 0; }
    .app-logo img { width: 146px; height: 48px; }
    .top-nav .nav-link { gap: 5px; padding-inline: 8px; font-size: 12px; }
    .header-user > span:last-child { display: none; }
}

@media (max-width: 1100px) {
    .app-logo img { width: 124px; height: 42px; }
    .top-nav .nav-link { padding-inline: 6px; font-size: 11px; }
    .header-account { padding-left: 7px; }
}

@media (max-width: 940px) {
    .app-header { display: none; }
    .app-shell { min-height: 100vh; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    .mobile-header { position: sticky; top: 0; z-index: 35; display: flex; height: 66px; padding: 9px 15px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; background: rgba(7,21,39,.97); box-shadow: 0 8px 24px rgba(7,21,39,.16); backdrop-filter: blur(16px); }
    .mobile-brand { position: relative; padding: 2px 7px; border: 1px solid rgba(255,255,255,.42); border-radius: 12px; background: linear-gradient(135deg,rgba(255,255,255,.9),rgba(238,248,255,.72)); box-shadow: 0 10px 32px rgba(4,15,29,.14); backdrop-filter: blur(14px) saturate(135%); }
    .mobile-brand::after { position: absolute; right: 7px; bottom: 4px; left: 7px; height: 1px; content: ""; background: linear-gradient(90deg,transparent,rgba(8,119,209,.48),transparent); opacity: .7; }
    .mobile-brand img { display: block; width: 124px; height: 42px; object-fit: contain; }
    .mobile-header .avatar { width: 39px; height: 39px; }
    .bottom-nav { position: fixed; z-index: 45; inset: auto 10px calc(9px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 68px; padding: 6px; border: 1px solid rgba(190,207,222,.9); border-radius: 20px; background: rgba(255,255,255,.97); box-shadow: 0 14px 44px rgba(7,21,39,.2); backdrop-filter: blur(18px); }
    .bottom-nav > a, .bottom-more > summary { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border-radius: 15px; color: #6a7d8f; list-style: none; cursor: pointer; }
    .bottom-more > summary::-webkit-details-marker { display: none; }
    .bottom-nav a span, .bottom-more > summary span { font-size: 19px; line-height: 1; }
    .bottom-nav a small, .bottom-more > summary small { font-size: 9px; font-weight: 800; }
    .bottom-nav > a.is-active, .bottom-more.is-active > summary { color: #0877d1; background: #e9f4ff; }
    .bottom-nav > a.mobile-primary-action { margin: -17px 3px 4px; color: #fff; border: 5px solid var(--canvas); border-radius: 50%; background: linear-gradient(145deg, #0788e5, #075fa8); box-shadow: 0 10px 25px rgba(8,119,209,.3); }
    .bottom-nav > a.mobile-primary-action span { font-size: 25px; }
    .bottom-nav > a.mobile-primary-action small { color: #fff; }
    .bottom-more { position: relative; min-width: 0; }
    .bottom-more > summary { height: 100%; }
    .mobile-more-menu { position: fixed; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; padding: 12px; border: 1px solid #cbd9e5; border-radius: 20px; background: rgba(255,255,255,.99); box-shadow: 0 20px 60px rgba(7,21,39,.24); }
    .bottom-more:not([open]) .mobile-more-menu { display: none; }
    .mobile-more-menu a, .mobile-more-menu button { display: flex; min-height: 48px; align-items: center; gap: 9px; padding: 0 13px; border: 0; border-radius: 13px; color: #30475d; background: #f3f7fa; font-size: 12px; font-weight: 800; text-align: left; }
    .mobile-more-menu a.is-active { color: #0877d1; background: #e9f4ff; }
    .mobile-more-menu form { margin: 0; }
    .mobile-more-menu form button { width: 100%; color: var(--danger); }
    .main-content { padding: 25px 15px 30px; }
    .page-heading { align-items: flex-start; }
    .page-heading h1 { font-size: 32px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stat-card { min-height: 105px; }
    .form-panel { padding: 23px; }
    .data-table td::before { font-size: 10px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .login-panel { min-height: 100vh; padding: 20px; background: radial-gradient(circle at 50% -10%, rgba(8,119,209,.23), transparent 35%), #edf3f8; }
    .login-card { padding: 30px 24px; }
    .mobile-login-brand { display: flex; margin-bottom: 32px; padding: 2px 7px; border-color: #d5e1eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(7,21,39,.1); }
}

@media (max-width: 620px) {
    .main-content { padding-inline: 12px; }
    .page-heading { align-items: stretch; flex-direction: column; gap: 14px; }
    .page-heading h1 { font-size: 29px; }
    .page-heading p { font-size: 13px; }
    .heading-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; overflow: visible; }
    .heading-actions .button { width: auto; flex: 1 1 140px; overflow: visible; padding-inline: 14px; font-size: 12px; }
    .heading-actions .button span { font-size: 16px; }
    .stat-grid { gap: 9px; }
    .stat-card { display: block; min-height: 120px; padding: 15px; }
    .stat-card strong { font-size: 25px; }
    .panel-heading { padding: 19px 17px 14px; }
    .filter-bar { padding: 11px; }
    .data-table tr { margin: 0 10px 10px; border: 1px solid #dce6ef; border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgba(7,21,39,.04); }
    .data-table tr:first-child { margin-top: 10px; }
    .form-panel { padding: 19px 16px; }
    .operation-switch label > span { min-height: 72px; }
    .photo-result-grid { grid-template-columns: 1fr; }
    .user-panel { padding: 18px; }
}

@media (max-width: 390px) {
    .mobile-brand img { width: 116px; height: 39px; }
    .bottom-nav { right: 6px; left: 6px; }
    .bottom-nav a small, .bottom-more > summary small { font-size: 8px; }
    .mobile-more-menu { right: 8px; left: 8px; }
}
