:root {
    --admin-ink: #292720;
    --admin-muted: #89867d;
    --admin-line: #eae8e2;
    --admin-paper: #fff;
    --admin-canvas: #f6f5f2;
    --admin-orange: #e96a38;
    --admin-orange-dark: #d85828;
    --admin-green: #477e59;
    --font-body: "DM Sans", sans-serif;
    --font-display: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--admin-canvas); color: var(--admin-ink); font: 13px var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .9fr) 1.1fr; background: #fff; }
.login-card { width: min(410px, calc(100% - 56px)); align-self: center; justify-self: center; padding: 55px 0; }
.admin-brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 68px; color: var(--admin-ink); font: 800 18px var(--font-display); letter-spacing: -.7px; text-decoration: none; }
.admin-brand > span:last-child i { color: #8b867c; font-style: normal; font-weight: 600; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; transform: rotate(-5deg); border-radius: 11px; background: var(--admin-orange); color: #fff; font: 800 25px var(--font-display); }
.eyebrow { display: block; color: #928c80; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.login-card h1 { margin: 13px 0 9px; font: 800 39px/1.12 var(--font-display); letter-spacing: -2.1px; }
.login-card > p { margin: 0 0 29px; color: #838076; font-size: 12px; line-height: 1.6; }
.login-card form, .admin-form { display: grid; gap: 16px; }
.login-card form > label, .admin-form > label { display: grid; gap: 7px; color: #46433c; font-size: 11px; font-weight: 600; }
.login-card input, .admin-form input:not([type="checkbox"]), .admin-form select, .admin-form textarea { width: 100%; min-height: 41px; padding: 10px 11px; outline: none; border: 1px solid #e7e4de; border-radius: 7px; background: #fff; color: var(--admin-ink); font-size: 12px; font-weight: 400; transition: border-color .15s ease, box-shadow .15s ease; }
.login-card input:focus, .admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: #df956f; box-shadow: 0 0 0 3px #faeee8; }
.admin-form textarea { resize: vertical; }
.login-card input::placeholder, .admin-form input::placeholder, .admin-form textarea::placeholder { color: #aaa69d; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.button:disabled { opacity: .55; cursor: wait; }
.button-primary { background: var(--admin-orange); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--admin-orange-dark); }
.button-primary > span { font-size: 16px; }
.login-card .button { min-height: 43px; margin-top: 1px; }
.login-card .button span { margin-left: auto; }
.button-secondary { border-color: #e6e3dc; background: #fff; color: #615d54; }
.button-secondary:hover:not(:disabled) { border-color: #d6c3b6; background: #fff9f5; }
.button-quiet { border: 0; background: transparent; color: var(--admin-orange-dark); }
.button-quiet:hover { background: #fff7f2; }
.back-to-store { display: inline-block; margin-top: 23px; color: #817c72; font-size: 11px; text-decoration: none; }
.back-to-store:hover { color: var(--admin-orange-dark); }
.login-visual { position: relative; display: flex; align-items: end; min-height: 100vh; overflow: hidden; padding: 39px; background: linear-gradient(0deg, #1b1613b8, #1b161300 45%), url("https://images.unsplash.com/photo-1550547660-d9450f859349?auto=format&fit=crop&w=1400&q=85") center/cover no-repeat, #aaa18c; }
.visual-tag { color: #fff; font-size: 9px; font-weight: 700; letter-spacing: 1.6px; }
.form-message { padding: 10px 11px; margin: 0; border-radius: 6px; background: #fff0ed; color: #a43d2a; font-size: 11px; line-height: 1.5; }
.form-message.success { background: #eff7f0; color: #397245; }

.dashboard { min-height: 100vh; }
.sidebar { width: 232px; position: fixed; z-index: 3; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 25px 15px 17px; border-right: 1px solid #eeece6; background: #fff; }
.sidebar .admin-brand { margin: 0 0 47px 5px; font-size: 17px; }
.sidebar-caption { padding: 0 9px; color: #aaa69d; font-size: 8px; font-weight: 700; letter-spacing: 1.3px; }
.admin-nav { display: grid; gap: 4px; margin-top: 12px; }
.nav-item { width: 100%; min-height: 39px; display: flex; align-items: center; gap: 11px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #77736a; cursor: pointer; text-align: left; font-size: 11px; font-weight: 500; transition: .15s ease; }
.nav-item > span:first-child { width: 16px; color: #979187; text-align: center; font-size: 15px; }
.nav-item:hover { background: #faf7f3; color: #594c3e; }
.nav-item.active { background: #fff2eb; color: #bd4e25; font-weight: 700; }
.nav-item.active > span:first-child { color: var(--admin-orange); }
.nav-count { min-width: 18px; height: 18px; display: grid; place-items: center; margin-left: auto; border-radius: 6px; background: #f2f0eb; color: #79746a; font-size: 9px; }
.sidebar-bottom { display: grid; gap: 12px; margin-top: auto; }
.store-link { display: flex; gap: 8px; padding: 0 10px 12px; border-bottom: 1px solid #efede8; color: #6c675d; font-size: 10px; text-decoration: none; }
.store-link:hover { color: var(--admin-orange-dark); }
.signed-in { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.admin-avatar { width: 31px; height: 31px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #eee9df; color: #72634f; font: 700 11px var(--font-display); }
.signed-in div { min-width: 0; display: grid; gap: 3px; }
.signed-in strong { overflow: hidden; color: #46433d; font-size: 10px; text-overflow: ellipsis; }
.signed-in small { color: #a09b91; font-size: 9px; }
.logout-button { padding: 0 5px; border: 0; background: transparent; color: #8a847a; cursor: pointer; text-align: left; font-size: 10px; }
.logout-button:hover { color: #bd4e25; }
.dashboard-main { min-height: 100vh; margin-left: 232px; }
.topbar { min-height: 80px; display: flex; align-items: center; justify-content: space-between; padding: 15px 36px; border-bottom: 1px solid #eeece6; background: #fff; }
.topbar-label { color: #a09b91; font-size: 8px; font-weight: 700; letter-spacing: 1.25px; }
.topbar h1 { margin: 4px 0 0; font: 750 18px var(--font-display); letter-spacing: -.6px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.mobile-logout { display: none; min-height: 31px; padding: 0 9px; border: 1px solid #ebe8e1; border-radius: 6px; background: #fff; color: #716c62; cursor: pointer; font-size: 9px; }
.live-status { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #e4eee3; border-radius: 999px; background: #f8fbf7; color: #527653; font-size: 10px; }
.live-status i { width: 6px; height: 6px; border-radius: 50%; background: #56a168; }
.live-status.closed { border-color: #f0e5d4; background: #fffbf4; color: #977646; }
.live-status.closed i { background: #d89a4b; }
.content-area { max-width: 1230px; padding: 25px 36px 42px; margin: 0 auto; }
.welcome-banner { min-height: 168px; position: relative; display: flex; align-items: center; overflow: hidden; padding: 24px 30px; border-radius: 12px; background: #ede8de; }
.welcome-banner .eyebrow { color: #8e8576; }
.welcome-banner h2 { margin: 8px 0 5px; font: 800 24px/1.2 var(--font-display); letter-spacing: -.9px; }
.welcome-banner p { margin: 0; color: #817b71; font-size: 10px; }
.welcome-flower { position: absolute; top: 11px; right: 33px; color: #d5cbb7; font-size: 144px; line-height: 1; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 17px; }
.metric-card { min-height: 105px; display: grid; align-content: center; gap: 5px; padding: 15px 17px; border: 1px solid var(--admin-line); border-radius: 9px; background: #fff; }
.metric-card > span { color: #8a857c; font-size: 10px; }
.metric-card > strong { font: 800 22px var(--font-display); letter-spacing: -.8px; }
.metric-card > small { color: #aaa59b; font-size: 9px; }
.panel-card { overflow: hidden; border: 1px solid var(--admin-line); border-radius: 9px; background: #fff; }
.overview-orders { margin-top: 18px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 18px 19px 14px; }
.panel-heading h2 { margin: 5px 0 0; font: 750 16px var(--font-display); letter-spacing: -.4px; }
.panel-heading p { margin: 5px 0 0; color: #959086; font-size: 10px; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #fbfaf8; }
th { padding: 10px 16px; color: #a19c92; font-size: 8px; font-weight: 700; letter-spacing: .75px; white-space: nowrap; }
td { padding: 11px 16px; border-top: 1px solid #f0eee9; color: #625e55; font-size: 10px; vertical-align: middle; }
.table-product { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.table-product img, .product-placeholder { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 7px; background: #eee9df; object-fit: cover; }
.table-product div { display: grid; gap: 4px; }
.table-product strong { color: #39362f; font-size: 10px; font-weight: 700; }
.table-product small { color: #a39e94; font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; background: #f4f2ee; color: #79746b; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #aaa59a; }
.status-badge.active, .status-badge.confirmed, .status-badge.delivered { background: #edf5ee; color: #47744e; }
.status-badge.active::before, .status-badge.confirmed::before, .status-badge.delivered::before { background: #5a9a65; }
.status-badge.pending { background: #fff4e5; color: #98713d; }
.status-badge.pending::before { background: #d89a4b; }
.status-badge.preparing { background: #edf3ff; color: #5573a2; }
.status-badge.preparing::before { background: #7293ca; }
.status-badge.ready { background: #f3eeff; color: #765ca4; }
.status-badge.ready::before { background: #9175c6; }
.status-badge.cancelled, .status-badge.inactive { background: #fff0ed; color: #a45240; }
.status-badge.cancelled::before, .status-badge.inactive::before { background: #ca705d; }
.table-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.table-action { min-height: 27px; padding: 0 8px; border: 1px solid #ebe8e1; border-radius: 5px; background: #fff; color: #726d62; cursor: pointer; font-size: 9px; }
.table-action:hover { border-color: #e5c7b5; color: #bd4e25; }
.table-action.danger { color: #a75243; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-toolbar p { margin: 5px 0 0; color: #8c877d; font-size: 11px; }
.section-toolbar > .button { flex: 0 0 auto; }
.filter-control { display: flex; align-items: center; gap: 8px; color: #8b857b; font-size: 10px; }
.filter-control select { min-width: 128px; min-height: 34px; padding: 0 9px; border: 1px solid #e8e5de; border-radius: 6px; background: #fff; color: #514d44; font-size: 10px; }
.empty-table { padding: 27px 18px; color: #918c82; text-align: center; font-size: 11px; }
.orders-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.order-card { overflow: hidden; border: 1px solid var(--admin-line); border-radius: 9px; background: #fff; }
.order-card-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; padding: 15px 15px 11px; border-bottom: 1px solid #f0eee9; }
.order-card-head h3 { margin: 0; color: #36332d; font: 750 12px var(--font-display); }
.order-card-head p { margin: 4px 0 0; color: #989389; font-size: 9px; }
.order-body { padding: 12px 15px; }
.order-customer { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 11px; color: #6f6a61; font-size: 10px; }
.order-customer a { color: #54805c; text-decoration: none; }
.order-items { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid #f2f0eb; border-bottom: 1px solid #f2f0eb; color: #6e695f; font-size: 10px; }
.order-totals { display: grid; gap: 5px; padding-top: 9px; }
.order-total-line { display: flex; justify-content: space-between; color: #8a857b; font-size: 10px; }
.order-total-line.final { color: #38352e; font-weight: 700; }
.order-address { margin: 9px 0 0; color: #868177; font-size: 9px; line-height: 1.6; }
.order-notes { margin: 7px 0 0; padding: 8px; border-radius: 6px; background: #f8f6f0; color: #706a60; font-size: 9px; line-height: 1.5; }
.order-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 15px 13px; }
.print-order-button { min-height: 32px; padding: 0 10px; border-color: #e6dfd5; color: #615543; }
.print-order-button:hover { border-color: #d7a77e; background: #fff9f3; color: #a94d2c; }
.order-actions select { width: 100%; min-height: 32px; padding: 0 8px; border: 1px solid #ebe8e1; border-radius: 6px; background: #fff; color: #666157; font-size: 10px; }
#thermal-print-root { display: none; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); align-items: start; gap: 14px; }
.settings-card { padding-bottom: 18px; }
.settings-card .panel-heading { padding-bottom: 16px; }
.settings-card .admin-form { padding: 0 19px; }
.admin-form small { color: #9a958b; font-size: 9px; font-weight: 400; }
.admin-form label:has(input[type="checkbox"]) { font-weight: 500; }
.form-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.toggle-setting { display: flex !important; align-items: center; gap: 10px !important; padding: 12px 0 3px; }
.toggle-setting input { width: 17px; height: 17px; margin: 0; accent-color: var(--admin-green); }
.toggle-setting > span { display: grid; gap: 4px; }
.toggle-setting strong { font-size: 11px; }
.toggle-setting small { line-height: 1.4; }
.password-card { grid-column: 2; }
.checkbox-options { display: grid; align-content: center; gap: 10px; }
.checkbox-options label { display: flex; align-items: center; gap: 7px; color: #625e55; font-size: 10px; }
.checkbox-options input { width: 14px; height: 14px; margin: 0; accent-color: var(--admin-orange); }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 20px; background: #241f19a1; backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none !important; }
.modal-card { width: min(100%, 540px); max-height: calc(100vh - 40px); position: relative; overflow-y: auto; padding: 28px 28px 24px; border-radius: 12px; background: #fff; box-shadow: 0 20px 70px #211e183d; }
.modal-card-small { width: min(100%, 450px); }
.modal-card > .eyebrow { color: var(--admin-orange-dark); }
.modal-card h2 { margin: 7px 0 5px; font: 800 22px var(--font-display); letter-spacing: -.8px; }
.modal-description { margin: 0 0 19px; color: #8c877e; font-size: 11px; line-height: 1.55; }
.modal-close { width: 30px; height: 30px; position: absolute; top: 15px; right: 15px; border: 0; border-radius: 50%; background: #f5f3ef; color: #6b665d; cursor: pointer; font-size: 20px; }
.modal-card .admin-form { gap: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: calc(100vw - 44px); transform: translateY(10px); opacity: 0; pointer-events: none; padding: 12px 15px; border-radius: 8px; background: #292720; color: #fff; box-shadow: 0 8px 24px #211e182b; font-size: 11px; transition: .18s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1050px) {
    .sidebar { width: 204px; }
    .dashboard-main { margin-left: 204px; }
    .topbar { padding-right: 24px; padding-left: 24px; }
    .content-area { padding-right: 24px; padding-left: 24px; }
    .orders-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .password-card { grid-column: 1; }
}
@media (max-width: 720px) {
    .login-screen { grid-template-columns: 1fr; }
    .login-card { width: min(410px, calc(100% - 42px)); padding: 34px 0 40px; }
    .login-card .admin-brand { margin-bottom: 51px; }
    .login-visual { min-height: 195px; padding: 22px; }
    .sidebar { width: auto; height: 60px; position: sticky; inset: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0 13px; border-right: 0; border-bottom: 1px solid #eeece6; }
    .sidebar .admin-brand { flex: 0 0 auto; margin: 0; gap: 7px; font-size: 14px; }
    .sidebar .brand-mark { width: 30px; height: 30px; font-size: 22px; }
    .sidebar-caption, .sidebar-bottom { display: none; }
    .admin-nav { min-width: 0; display: flex; overflow-x: auto; gap: 4px; margin: 0 0 0 auto; scrollbar-width: none; }
    .admin-nav::-webkit-scrollbar { display: none; }
    .nav-item { width: auto; min-height: 34px; flex: 0 0 auto; gap: 6px; padding: 0 8px; font-size: 9px; white-space: nowrap; }
    .nav-item > span:first-child { width: auto; font-size: 13px; }
    .nav-count { min-width: 15px; height: 15px; font-size: 8px; }
    .dashboard-main { min-height: calc(100vh - 60px); margin-left: 0; }
    .topbar { min-height: 65px; padding: 11px 16px; }
    .topbar h1 { font-size: 16px; }
    .mobile-logout { display: inline-flex; align-items: center; }
    .live-status { padding: 6px 8px; font-size: 9px; }
    .content-area { padding: 16px 14px 35px; }
    .welcome-banner { min-height: 147px; padding: 20px; }
    .welcome-banner h2 { font-size: 21px; }
    .welcome-flower { top: 17px; right: 6px; font-size: 103px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
    .metric-card { min-height: 87px; padding: 12px; }
    .metric-card:last-child { grid-column: 1 / -1; min-height: 78px; }
    .metric-card > strong { font-size: 19px; }
    .overview-orders { margin-top: 10px; }
    .panel-heading { padding: 14px 13px 12px; }
    .panel-heading h2 { font-size: 14px; }
    th { padding: 9px 11px; }
    td { padding: 9px 11px; }
    .section-toolbar { align-items: flex-start; flex-wrap: wrap; }
    .section-toolbar > .button { min-height: 35px; padding: 0 10px; font-size: 10px; }
    .filter-control { margin-left: auto; }
    .settings-grid { gap: 10px; }
    .order-actions { grid-template-columns: minmax(0, 1fr); }
    .print-order-button { min-height: 35px; }
    .form-two-columns { gap: 8px; }
    .settings-card .admin-form { padding: 0 13px; }
    .settings-card .panel-heading { padding-right: 13px; padding-left: 13px; }
    .modal-card { padding: 25px 18px 19px; }
}
@media (max-width: 410px) {
    .sidebar { gap: 4px; padding: 0 8px; }
    .sidebar .admin-brand { gap: 5px; }
    .sidebar .admin-brand > span:last-child { display: none; }
    .sidebar .brand-mark { width: 27px; height: 27px; }
    .nav-item { gap: 4px; padding: 0 6px; font-size: 0; }
    .nav-item > span:first-child { font-size: 12px; }
    .nav-count { font-size: 8px; }
    .form-two-columns { grid-template-columns: 1fr; }
    .checkbox-options { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@page { size: 58mm auto; margin: 0; }
@media print {
    body, body * { visibility: hidden !important; }
    #thermal-print-root, #thermal-print-root * { visibility: visible !important; }
    #thermal-print-root { width: 48mm; max-width: 48mm; display: block !important; position: absolute; top: 0; left: -2mm; margin: 0; padding: 1mm 0 3mm; background: #fff; color: #000; font: 10px/1.35 Arial, Helvetica, sans-serif; }
    #thermal-print-root * { box-sizing: border-box; }
    .receipt-header, .receipt-section { padding: 2.5mm 0; border-bottom: 1px dashed #555; overflow-wrap: anywhere; }
    .receipt-header { text-align: center; }
    .receipt-header h1 { margin: 0 0 1.5mm; font-size: 14px; }
    .receipt-header p { margin: 1mm 0; }
    .receipt-fulfillment { font-size: 13px; font-weight: 800; }
    .receipt-label { margin: 0 0 1.5mm; font-size: 8px; font-weight: 700; letter-spacing: .4px; }
    .receipt-customer { margin: 1mm 0; font-size: 13px; font-weight: 800; }
    .receipt-address { margin: 1mm 0; font-size: 11px; font-weight: 700; line-height: 1.4; }
    .receipt-section .item { padding: 1.5mm 0; border-bottom: 1px dotted #aaa; font-weight: 700; overflow-wrap: anywhere; break-inside: avoid; }
    .receipt-section .item-note { padding-top: .5mm; font-size: 9px; font-weight: 400; }
    .receipt-section .item-price { display: flex; justify-content: space-between; gap: 1mm; padding-top: .5mm; font-size: 9px; font-weight: 400; }
    .receipt-section .item-price span { min-width: 0; overflow-wrap: anywhere; }
    .receipt-section .item-price strong { flex: 0 0 auto; }
    .receipt-line { display: flex; justify-content: space-between; gap: 1mm; padding: 1mm 0; break-inside: avoid; }
    .receipt-line span { min-width: 0; overflow-wrap: anywhere; }
    .receipt-line strong { flex: 0 0 auto; }
    .receipt-total { margin-top: 1mm; padding-top: 2mm; border-top: 1px solid #000; font-size: 13px; font-weight: 800; }
    .notes { padding-top: 2mm; overflow-wrap: anywhere; }
    .notes p { margin: 1mm 0 0; font-size: 10px; }
    .receipt-footer { padding-top: 2mm; text-align: center; font-size: 8px; }
}
