/* style.css */
:root {
    --primary: #2196F3;
    --green: #4CAF50;
    --red: #F44336;
    --bg: #f4f7f6;
    --card: #ffffff;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); margin: 0; padding: 0; overscroll-behavior-y: none; }
* { box-sizing: border-box; }

/* Login */
.login-page { display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-box { background: var(--card); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 90%; max-width: 400px; text-align: center; }
.login-box input { width: 100%; padding: 12px; margin: 8px 0; border: 1px solid #ddd; border-radius: 4px; font-size: 16px; }

/* Dashboard */
.header { background: #333; color: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.container { padding: 15px; max-width: 800px; margin: 0 auto; }

.dashboard-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 15px; 
}

/* Tablet/Desktop */
@media (min-width: 600px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

.dash-box {
    display: block;
    padding: 25px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: center;
    transition: transform 0.1s;
}
.dash-box:active { transform: scale(0.98); }
.dash-box h3 { margin: 0; font-size: 1.2rem; }
.dash-box p { margin: 5px 0 0; opacity: 0.9; font-size: 0.9rem; }

/* Colors */
.box-green       { background: #16a34a; } /* Lush Green */
.box-orange      { background: #ea580c; } /* Burnt Orange */
.box-blue        { background: #2563eb; } /* Royal Blue */
.box-lightblue   { background: #0ea5e9; } /* Sky Blue */
.box-purple      { background: #7c3aed; } /* Deep Violet */
.box-lightpurple { background: #c026d3; } /* Fuchsia */
.box-red         { background: #dc2626; } /* Standard Red */
.box-teal        { background: #0d9488; } /* Deep Teal */
.box-cyan        { background: #475569; } /* Slate Blue-Grey (Better for Admin) */

/* Buttons */
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px; width: 100%; border-radius: 4px; font-size: 16px; cursor: pointer; }
.btn-small { background: #555; color: white; padding: 5px 10px; border-radius: 4px; text-decoration: none; font-size: 0.8rem; }

/* Passcode */
.passcode-input {
    text-align: center;
    font-size: 1.2rem !important; /* Smaller font */
    letter-spacing: 3px;          /* Tighter spacing for dots */
    width: 80% !important;
    margin: 15px auto !important;
    display: block;
}

/* ============================================
   App Shell (Header / Sub-header / Main)
   Used by core/layout.php
   ============================================ */
.header-outer { width: 100%; background-color: #fff; border-bottom: 1px solid #ccc; position: sticky; top: 0; z-index: 200; box-shadow: 0 1px 3px rgba(0,0,0,0.05); padding-top: env(safe-area-inset-top); }
.header-inner { max-width: 768px; margin: 0 auto; padding: 0 15px; height: 50px; display: flex; justify-content: space-between; align-items: center; }
.header-left { flex: 1; text-align: left; display: flex; align-items: center; gap: 8px; }
.header-center { flex: 2; text-align: center; font-weight: bold; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { flex: 1; text-align: right; }
.header-link { text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.link-home { color: #007bff; }
.link-back { color: #666; }
.link-logout { color: #dc3545; }
.sub-header { background: #f8f9fa; border-bottom: 1px solid #ddd; padding: 8px 15px; }
.sub-header-inner { max-width: 768px; margin: 0 auto; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; justify-content: space-between; }
.sub-header-nav { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.store-select { border: 1px solid #ccc; background: #fff; font-size: 0.95rem; font-weight: bold; color: #333; padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.store-label { font-weight: bold; color: #333; }
.sub-nav-link { color: #555; text-decoration: none; font-weight: bold; font-size: 0.9rem; }
.sub-nav-link:hover { color: #007bff; }
.sub-nav-link.active { color: #007bff; }
.main-container { max-width: 768px; margin: 0 auto; padding: 15px; display: flex; flex-direction: column; }

/* Page width variants: 768px portrait, 900px+ landscape */
.page-fullwidth .header-inner { max-width: none; padding: 0 20px; }
.page-fullwidth .sub-header-inner { max-width: none; padding: 0 20px; }
.page-fullwidth .main-container { max-width: none; padding: 0 20px; }
.page-wide .header-inner { max-width: 1150px; }
.page-wide .sub-header-inner { max-width: 1150px; }
.page-wide .main-container { max-width: 1150px; display: flex; flex-direction: column; background: #fff; border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0; min-height: calc(100vh - 50px); padding: 0; }

/* ============================================
   Schedule Module
   ============================================ */

/* Schedule Edit - Toolbar */
.sticky-toolbar { position: sticky; top: 50px; z-index: 150; background: #f8f9fa; border-bottom: 1px solid #ddd; padding: 10px 15px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.toolbar-group { display: flex; gap: 5px; align-items: center; }
.toolbar-group:last-child { margin-left: auto; }
.btn-tool { padding: 6px 12px; border: 1px solid #ccc; background: #fff; color: #333; font-size: 0.8rem; border-radius: 4px; cursor: pointer; white-space: nowrap; min-width: 60px; text-align: center; }
.btn-active { background: var(--green); color: white; border-color: var(--green); }
.btn-inactive { background: #fff; color: #777; border-color: #ddd; }

/* Schedule Edit - Grid */
.grid-wrapper { overflow-x: auto; flex: 0 0 auto; position: relative; background: #fff; padding-bottom: 0; }
.grid-wrapper::-webkit-scrollbar { height: 12px; }
.grid-wrapper::-webkit-scrollbar-track { background: #f1f1f1; border-top: 1px solid #ddd; }
.grid-wrapper::-webkit-scrollbar-thumb { background: #888; border-radius: 6px; border: 2px solid #f1f1f1; }
.grid-wrapper::-webkit-scrollbar-thumb:hover { background: #555; }
.edit-table { border-collapse: separate; border-spacing: 0; min-width: 1100px; width: 100%; font-size: 0.8rem; table-layout: fixed; }
.edit-table th, .edit-table td { border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; padding: 0; text-align: center; height: 34px; box-sizing: border-box; }
.col-name { position: sticky; left: 0; z-index: 30; width: 100px; min-width: 100px; border-right: 2px solid #aaa; background-color: #fff; }
.edit-table thead th { position: sticky; top: 0; z-index: 40; background: #333; color: white; height: 40px; }
.edit-table thead th.col-name { z-index: 50; background: #333; }
.edit-table tfoot th, .edit-table tfoot td { position: sticky; bottom: 0; z-index: 40; background: #eee; border-top: 2px solid #666; font-weight: bold; }
.edit-table tfoot td.col-name { z-index: 50; background: #cfd8dc; }
.col-total { font-weight: bold; background: #f9f9f9; width: 60px; min-width: 60px; border-left: 2px solid #ddd; position: sticky; right: 0; z-index: 30; }
thead th.col-total { z-index: 50; }
.edit-table tfoot td.col-total { z-index: 50; right: 0; position: sticky; border-left: 2px solid #ddd; }
.row-last-year td:not(.col-name) { background: #f0f0f0; color: #666; }
.row-sales td:not(.col-name) { background: #fff3e0; }
.row-mall td:not(.col-name) { background: #f3e5f5; }
.row-notes td:not(.col-name) { background: #e0f7fa; }
.row-notes td { height: 80px; }
.row-requests td { background: #fff8e1; height: 80px; }
.row-daily-hrs td { background: #cfd8dc; color: #000; }
.row-diff td { background: #ECEFF1; color: #333; }
.row-labor td { background: #fff; }
.cell-input { width: 100%; height: 100%; border: none; padding: 0; text-align: center; font-size: 0.8rem; background: transparent; outline: none; }
textarea.cell-input { padding: 5px; resize: none; line-height: 1.2; text-align: left; }
.shift-cell { cursor: pointer; padding: 0; vertical-align: middle; }
.shift-card { background: #e8f5e9; border: 1px solid #4CAF50; border-radius: 4px; color: #2e7d32; font-weight: bold; width: 90%; height: 80%; margin: 0 auto; display: flex; align-items: center; justify-content: center; pointer-events: auto; font-size: 0.75rem; }
.cell-selected { background-color: #2196F3 !important; }
.bg-bad { background-color: #ffcdd2 !important; color: #c62828 !important; }
.global-notes-container { padding: 15px; border-top: 1px solid #ccc; background: #fff; }
.global-notes-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; height: 300px; }
.notes-grid .note-cell { height: 100%; display: flex; flex-direction: column; }
.note-textarea { flex: 1; border: 1px solid #ccc; padding: 10px; resize: none; border-radius: 4px; }
#timePicker { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 15px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 6000; width: 320px; }
.tp-split-display { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 5px; }
.tp-box { border: 2px solid #ddd; padding: 5px 15px; border-radius: 4px; font-size: 1.2rem; font-weight: bold; cursor: pointer; min-width: 80px; text-align: center; }
.tp-box.tp-active { border-color: var(--primary); background: #e3f2fd; color: var(--primary); }
.tp-duration { text-align: center; font-size: 0.9rem; font-weight: bold; color: #555; margin-bottom: 10px; height: 1.2em; }
.tp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 10px 0; }
.tp-btn { padding: 8px 0; border: 1px solid #ddd; background: white; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.tp-btn:hover { background: #eee; }
.tp-btn.tp-selected { background: #c8e6c9 !important; border-color: #4CAF50 !important; color: #2e7d32; font-weight: bold; }
.tp-action-row { display: flex; gap: 5px; margin-top: 15px; }
.tp-action-btn { flex: 1; border: none; border-radius: 4px; font-size: 0.8rem; padding: 8px 0; color: white; cursor: pointer; }
#tpOverlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); z-index: 5900; }

/* Schedule Manager - Hub */
.quick-actions { margin-bottom: 20px; display: flex; justify-content: flex-end; }
.btn-live { background: #28a745; color: white; text-decoration: none; padding: 8px 15px; border-radius: 4px; font-size: 0.9rem; font-weight: bold; display: inline-block; }
.section-title { margin: 10px 0 15px 0; font-size: 0.9rem; color: #777; border-bottom: 1px solid #ddd; padding-bottom: 5px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; margin-bottom: 30px; }
.week-card { padding: 20px; border-radius: 8px; color: #333; box-shadow: 0 2px 5px rgba(0,0,0,0.1); border-left: 6px solid transparent; background: #fff; position: relative; display: flex; flex-direction: column; }
.week-card h3 { margin: 0 0 5px 0; font-size: 1.3rem; }
.week-card.box-green { border-left-color: #4CAF50; }
.week-card.box-yellow { border-left-color: #FFC107; }
.week-card.box-gray { border-left-color: #9E9E9E; }
.week-card.box-blue { border-left-color: #2196F3; }
.status-badge { position: absolute; top: 20px; right: 20px; padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; color: white; }
.bg-green { background: #4CAF50; }
.bg-yellow { background: #FFC107; color: #333; }
.bg-gray { background: #9E9E9E; }
.bg-blue { background: #2196F3; }
.card-actions { margin-top: auto; padding-top: 15px; display: flex; gap: 10px; }
.btn-act { flex: 1; padding: 10px; text-align: center; border-radius: 4px; text-decoration: none; font-weight: bold; border: 1px solid #ddd; background: #f9f9f9; color: #333; cursor: pointer; font-size: 0.9rem; }
button.btn-act { width: 100%; border: none; font-family: inherit; }
.btn-act:hover { background: #eee; }
.btn-primary-act { background: #007bff; color: white; border: none; }
.btn-primary-act:hover { background: #0056b3; }
.week-input-card { width: 100%; padding: 8px; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px; background: #f8f9fa; color: #333; box-sizing: border-box; margin: 10px 0; }

/* Schedule View */
@media (max-width: 480px) { .header-inner { padding: 0 10px; } }
.week-box { background: #fff; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); border-radius: 8px; overflow: hidden; }
.week-header { background: #A9D08E; color: #333; padding: 10px 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.week-header-blue { background: #2196F3; color: #fff; padding: 10px 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.update-time { font-weight: normal; font-size: 0.85rem; background: rgba(255,255,255,0.3); padding: 2px 8px; border-radius: 4px; }
.sched-container { width: 100%; overflow-x: auto; background: white; position: relative; padding-bottom: 5px; }
.sched-container::-webkit-scrollbar { height: 12px; width: 12px; }
.sched-container::-webkit-scrollbar-track { background: #f1f1f1; border-top: 1px solid #ddd; }
.sched-container::-webkit-scrollbar-thumb { background: #888; border-radius: 6px; border: 2px solid #f1f1f1; }
.sched-container::-webkit-scrollbar-thumb:hover { background: #555; }
.sched-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; font-size: 0.85rem; }
.sched-table th, .sched-table td { border: 1px solid #ccc; padding: 3px 5px; text-align: center; vertical-align: middle; white-space: nowrap; font-weight: normal; }
.sched-table thead th { position: sticky; top: 0; background: #ffffff; color: #000000; z-index: 100; height: 35px; border-bottom: 2px solid #999; }
.sched-table .sticky-col { position: sticky; left: 0; background: #ffffff; color: #000000; z-index: 90; border-right: 2px solid #999; min-width: 100px; }
.sched-table thead th.sticky-col { z-index: 110; }
.today-highlight { background-color: #fff8e1 !important; border-bottom: 3px solid #ffca28 !important; }
.row-meta td { background-color: #f4f4f4; font-weight: bold; }
.sched-table .note-cell { color: #cc0000 !important; font-size: 0.8rem; white-space: normal !important; min-width: 80px; max-width: 130px; line-height: 1.1; }
.policy-box { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); border-left: 5px solid #FFC107; margin-bottom: 20px; }
.mgr-select { background: white; border: none; padding: 5px; border-radius: 4px; font-weight: bold; }
.empty-msg { padding: 20px; text-align: center; color: #777; font-style: italic; }
.status-unread { font-weight: 900 !important; color: #000 !important; }
.status-read { font-weight: normal !important; color: #000 !important; }

/* ============================================
   Time Module
   ============================================ */
/* Time Clock */
.page-clock .main-container { min-height: calc(100vh - 50px); box-sizing: border-box; }
.clock-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 100%; padding-top: 20px; }
.std-box { width: 100%; max-width: 400px; box-sizing: border-box; margin-left: auto; margin-right: auto; }
.clock-container { text-align: center; padding: 20px; background: white; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin-bottom: 20px; }
.clock-time { font-size: 3.5rem; font-weight: bold; color: #333; margin: 10px 0; font-family: monospace; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 1.1rem; color: #777; margin-bottom: 20px; }
.greeting { font-size: 1.2rem; font-weight: bold; color: var(--primary); margin-bottom: 5px; }
.btn-clock { width: 100%; padding: 25px; font-size: 1.5rem; border: none; border-radius: 12px; color: white; cursor: pointer; text-transform: uppercase; font-weight: bold; box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: all 0.2s; }
.btn-clock:disabled { cursor: not-allowed; opacity: 0.7; box-shadow: none; transform: none; }
.btn-in { background: linear-gradient(135deg, #4CAF50, #2E7D32); }
.btn-out { background: linear-gradient(135deg, #F44336, #C62828); }
.verify-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.v-badge { padding: 10px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; border: 1px solid #ccc; cursor: pointer; transition: 0.3s; flex: 1; text-align: center; background: white; }
.v-pass { color: #2e7d32; border-color: #2e7d32; }
.v-fail { color: #c62828; border-color: #c62828; }
.v-wait { color: #777; border-color: #ddd; }
.gray-box { background: #e0e0e0; padding: 15px; border-radius: 8px; font-size: 0.9rem; color: #555; border: 1px solid #ccc; margin-bottom: 20px; }
.debug-ip { font-size: 0.75rem; color: #777; margin-top: 10px; line-height: 1.4; }
.policy-list { text-align: left; margin: 0; padding-left: 20px; line-height: 1.4; }
.policy-list li { margin-bottom: 8px; }
.warning-msg { color: #d32f2f; font-size: 0.9rem; margin-bottom: 15px; background: #ffebee; padding: 10px; border-radius: 4px; display: none; text-align: center; }
.perm-help { display: none; margin-bottom: 15px; font-size: 0.85rem; color: #d32f2f; background: #ffebee; padding: 10px; border-radius: 8px; text-align: left; }
.error-alert { background: #ffebee; color: #c62828; border: 1px solid #c62828; padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; font-weight: bold; }

/* Time Logs (edit_log) */
.filter-bar { display: flex; gap: 10px; margin-bottom: 15px; background: #fff; padding: 10px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.filter-item { flex: 1; }
.filter-item label { display: block; font-size: 0.75rem; color: #666; margin-bottom: 3px; font-weight: bold; }
.filter-input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; background: #f9f9f9; font-size: 0.9rem; box-sizing: border-box; }
.table-wrapper { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow-x: auto; max-height: 75vh; }
.log-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; min-width: 600px; }
.log-table th { background: #333; color: white; padding: 10px 5px; text-align: center; position: sticky; top: 0; z-index: 100; font-size: 0.8rem; }
.log-table td { padding: 8px 5px; border-bottom: 1px solid #eee; vertical-align: middle; text-align: center; }
.log-table .sticky-col { position: sticky; left: 0; z-index: 50; background: #fff; border-right: 2px solid #ccc; min-width: 70px; }
.log-table th.sticky-col { background: #333; z-index: 110; }
.row-pink { background-color: #fff5f5 !important; }
.row-pink .sticky-col { background-color: #fff5f5 !important; }
.row-grey { background-color: #f5f5f5 !important; }
.row-grey .sticky-col { background-color: #f5f5f5 !important; }
.icon-row { display: flex; justify-content: center; gap: 15px; align-items: center; }
.icon-box { cursor: pointer; font-size: 1.2rem; position: relative; line-height: 1; }
.badge-x { position: absolute; top: -5px; right: -8px; font-size: 0.6rem; color: white; background: #c62828; border-radius: 50%; width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 1px solid white; z-index: 10; }
.legend-box { margin-top: 20px; padding: 15px; background: #f9f9f9; border: 1px solid #eee; border-radius: 4px; font-size: 0.8rem; color: #555; }
.leg-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.leg-color { width: 20px; height: 20px; border: 1px solid #ccc; }
.modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 20px; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 5000; width: 440px; max-width: 95%; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 4900; }
.card-header { text-align: center; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.card-title { font-weight: bold; font-size: 1.1rem; color: #333; }
.card-sub { font-size: 0.85rem; color: #777; }
.edit-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.edit-label { width: 40px; font-weight: bold; color: #555; }
.edit-input { width: 140px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; text-align: center; font-size: 1rem; }
.sec-block { border-bottom: 1px solid #eee; padding: 10px 0; }
.sec-block-alert { background-color: #fff0f0; border: 1px solid #ffcdd2; border-radius: 4px; padding: 10px; }
.sec-title { font-weight: bold; margin-bottom: 5px; background: #f5f5f5; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; display: flex; justify-content: space-between; }
.sec-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 0.9rem; }
.st-pass { color: #2e7d32; font-weight: bold; margin-left: 5px; }
.st-fail { color: #c62828; font-weight: bold; margin-left: 5px; }
.btn-map, .btn-over { padding: 2px 8px; border-radius: 3px; cursor: pointer; font-size: 0.75rem; text-decoration: none; display: inline-block; }
.btn-map { background: #2196F3; color: white; }
.btn-over { background: #FF9800; color: white; margin-left: 5px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn-act { flex: 1; padding: 10px; border: none; border-radius: 4px; color: white; cursor: pointer; font-weight: bold; font-size: 0.9rem; }
.chk-del { display: flex; width: 40px; justify-content: center; align-items: center; background: #ffebee; padding: 5px 0; border-radius: 4px; border: 1px solid #ffcdd2; cursor: pointer; box-sizing: border-box; }
.chk-del input { margin-right: 3px; cursor: pointer; }
.chk-del small { color: #c62828; font-weight: bold; font-size: 0.8rem; }

/* Time Override */
.override-box { max-width: 500px; margin: 20px auto; padding: 20px; background: white; border-radius: 8px; text-align: center; }
.img-box { display: flex; gap: 10px; overflow-x: auto; margin: 20px 0; justify-content: center; }
.img-box img { height: 150px; border-radius: 4px; border: 1px solid #ddd; }
.btn-yes { background: #FF9800; color: white; padding: 15px 30px; font-size: 1.2rem; border: none; border-radius: 6px; cursor: pointer; width: 100%; font-weight: bold; }
.btn-yes:hover { background: #F57C00; }
.btn-no { display: block; margin-top: 15px; color: #777; text-decoration: none; }
.warn-list { background: #fff3e0; color: #e65100; padding: 10px; border-radius: 4px; margin: 15px 0; font-weight: bold; }

/* ============================================
   Payroll Module
   ============================================ */
.payroll-legend { display: flex; gap: 15px; font-size: 0.8rem; white-space: nowrap; }
.payroll-legend .leg-item { display: flex; align-items: center; gap: 5px; }
.payroll-legend .leg-box { width: 12px; height: 12px; border-radius: 2px; border: 1px solid #ccc; }
.payroll-legend .leg-box.st-green { background: #e8f5e9; }
.payroll-legend .leg-box.st-yellow { background: #fff3e0; }
.payroll-legend .leg-box.st-red { background: #ffebee; }
.sub-header .btn-tool:hover:not(.btn-active) { background: #f9f9f9; }
.sub-header .store-select:hover { background: #f0f0f0; }
.store-box { background: white; margin: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; }
.store-title { background: #455a64; color: white; padding: 10px 15px; font-weight: bold; display: flex; align-items: center; justify-content: space-between; transition: background 0.3s; }
.store-title.saved-state { background: #2e7d32; }
.save-badge { background: white; color: #2e7d32; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; margin-left: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); display: none; }
.store-title.saved-state .save-badge { display: block; }
.store-box .grid-wrapper { overflow-x: auto; position: relative; max-height: calc(100vh - 150px); }
.pay-table { border-collapse: separate; border-spacing: 0; font-size: 0.85rem; min-width: 2200px; }
.pay-table th, .pay-table td { border-right: 1px solid #eee; border-bottom: 1px solid #eee; padding: 5px; text-align: center; height: 35px; }
.pay-table .col-name { position: sticky; left: 0; background: white; z-index: 100; border-right: 2px solid #ccc; width: 120px; font-weight: bold; }
.pay-table .col-total { position: sticky; left: 120px; background: #fffde7; z-index: 100; border-right: 2px solid #999; width: 60px; font-weight: bold; color: var(--primary); }
.pay-table thead th { position: sticky; top: 0; background: #eee; z-index: 90; height: 40px; }
.pay-table thead th.col-name, .pay-table thead th.col-total { z-index: 110; background: #ddd; }
.pay-table tfoot th { position: sticky; bottom: 0; background: #333; color: white; z-index: 90; height: 40px; border-top: 2px solid #000; }
.pay-table tfoot th.col-name, .pay-table tfoot th.col-total { z-index: 110; background: #222; }
.pay-table .val-adj { color: #1565C0; font-weight: bold; cursor: pointer; background: #e3f2fd; }
.pay-table .st-green { color: #2e7d32; background: #e8f5e9; }
.pay-table .st-yellow { color: #ef6c00; background: #fff3e0; }
.pay-table .st-red { color: #c62828; background: #ffebee; }
.pay-table .val-act { font-weight: bold; cursor: pointer; }
.pay-table .day-head { border-right: 2px solid #aaa !important; background: #f0f0f0; }
.pay-table .weekend { background-color: #cfd8dc !important; }
.pay-table .cell-grp { border-right: 2px solid #aaa !important; }
.pay-modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 25px; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 3000; width: 400px; }
.pay-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 2900; }
.adj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0; }
.adj-btn { padding: 10px; border: 1px solid #ccc; background: white; border-radius: 4px; cursor: pointer; font-weight: bold; text-align: center; }
.adj-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.toggle-row { display: flex; margin-bottom: 10px; }
.toggle-btn { flex: 1; padding: 8px; border: 1px solid #ccc; background: #f5f5f5; cursor: pointer; text-align: center; }
.toggle-btn.active { background: #333; color: white; }
.pay-modal .edit-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; justify-content: space-between; }
.pay-modal .edit-label { width: 50px; font-weight: bold; color: #555; font-size: 0.9rem; }
.pay-modal .edit-input { width: 130px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; text-align: center; }
.pay-modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.pay-modal .btn-act { flex: 1; padding: 10px; border: none; border-radius: 4px; color: white; cursor: pointer; font-weight: bold; text-align: center; text-decoration: none; font-size: 0.9rem; line-height: 1.2; }

/* ========== INVENTORY MODULE ========== */
.inv-btn-header { background: #007bff; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; text-decoration: none; display: inline-block; }
.inv-btn-header:hover { background: #0056b3; }
.inv-page-actions { padding: 10px 15px; display: flex; justify-content: flex-end; gap: 8px; }
.max-width-container { max-width: 768px; margin: 0 auto; background-color: #fff; min-height: calc(100vh - 50px); position: relative; width: 100%; }
.inv-count .max-width-container { min-height: 100vh; box-shadow: 0 0 15px rgba(0,0,0,0.1); border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0; }

/* Plan */
.inv-plan .sticky-toolbar { position: sticky; top: 50px; z-index: 90; background: #fff; border-bottom: 1px solid #ddd; padding: 10px; max-width: 768px; margin: 0 auto; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.inv-plan .control-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.inv-plan .plan-selector { width: 160px; flex: none; }
.inv-plan .plan-select-box { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 6px; font-weight: bold; font-size: 13px; background: #f8f9fa; color: #333; }
.inv-plan .strategy-bar { display: flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; flex: 1; justify-content: flex-end; }
.inv-plan .strategy-box { background: #fff; padding: 6px 8px; border-radius: 4px; border: 1px solid #ccc; display: flex; align-items: center; gap: 5px; }
.inv-plan .tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.inv-plan .tab-btn { padding: 6px 12px; background: #eee; border-radius: 14px; cursor: pointer; border: 1px solid #ddd; white-space: nowrap; font-size: 13px; color: #555; }
.inv-plan .tab-btn.active { background: #007bff; color: white; border-color: #007bff; }
.inv-plan .drivers-container { display: flex; gap: 10px; overflow-x: auto; padding: 10px; border-bottom: 1px solid #eee; background: #fcfcfc; }
.inv-plan .store-driver { background: #fff; border: 1px solid #ccc; padding: 8px; border-radius: 6px; min-width: 210px; flex: 1; border-top: 4px solid #007bff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.inv-plan .driver-header { font-weight: bold; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 4px; font-size: 14px; text-align: center; }
.inv-plan .driver-grid { display: grid; grid-template-columns: max-content auto 35px; gap: 5px 8px; align-items: center; font-size: 11px; }
.inv-plan .d-label { color: #555; text-align: left; }
.inv-plan .d-val { display: flex; align-items: center; width: 100%; }
.inv-plan .d-val input { width: 100%; padding: 4px; border: 1px solid #ccc; border-radius: 3px; font-size: 12px; }
.inv-plan .d-day { font-weight: bold; color: #666; text-align: right; font-size: 10px; }
.inv-plan .val-ro { font-weight: bold; font-size: 12px; }
.inv-plan .calc-info { font-weight: bold; color: #28a745; font-size: 10px; background: #e8f5e9; padding: 1px 4px; border-radius: 3px; margin-left: 4px; }
.inv-plan .date-auto { background-color: #e3f2fd !important; border: 1px solid #2196f3 !important; color: #0d47a1 !important; font-weight: bold; }
.inv-plan .date-manual { background-color: #e8f5e9 !important; border: 1px solid #4caf50 !important; color: #1b5e20 !important; font-weight: bold; }
.inv-plan .min-warn { color: #dc3545; font-weight: bold; }
.inv-plan .min-ok { color: #28a745; }
.inv-plan .matrix-wrapper { overflow-x: auto; background: #fff; }
.inv-plan .matrix-wrapper table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 0 !important; font-size: 12px; }
.inv-plan .matrix-wrapper th, .inv-plan .matrix-wrapper td { padding: 4px 2px; border-bottom: 1px solid #eee; border-right: 1px solid #eee; text-align: center; vertical-align: middle; }
.inv-plan .matrix-wrapper thead th { position: sticky; top: 0; background: #333; color: #fff; z-index: 20; height: 30px; font-weight: normal; }
.inv-plan .matrix-wrapper td:first-child, .inv-plan .matrix-wrapper th:first-child { position: sticky; left: 0; background: #fff; z-index: 15; text-align: left; padding-left: 5px; border-right: 2px solid #ccc; width: 100px; min-width: 100px; max-width: 100px; }
.inv-plan .matrix-wrapper thead th:first-child { background: #333; z-index: 25; }
.inv-plan .matrix-wrapper tbody.group-odd td { background-color: #ffffff; }
.inv-plan .matrix-wrapper tbody.group-even td { background-color: #f4f4f4; }
.inv-plan .matrix-wrapper .item-cell { display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 38px; padding-left: 5px; }
.inv-plan .matrix-wrapper .ic-top { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; }
.inv-plan .matrix-wrapper .ic-bot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 2px; width: 100%; }
.inv-plan .matrix-wrapper .i-name { font-weight: bold; font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.inv-plan .matrix-wrapper .i-price { font-size: 11px; color: #007bff; cursor: pointer; margin-left: auto; }
.inv-plan .matrix-wrapper .i-var { font-size: 11px; color: #666; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.inv-plan .matrix-wrapper .i-arrow { cursor: pointer; font-size: 14px; line-height: 1; padding: 0 5px; }
.inv-plan .matrix-wrapper .sub-row { display: none; }
.inv-plan .matrix-wrapper .sub-row.visible { display: table-row; }
.inv-plan .matrix-wrapper .col-store-group { border-left: 2px solid #ccc; }
.inv-plan .matrix-wrapper .s-val { display: block; font-weight: bold; font-size: 12px; color: #333; }
.inv-plan .matrix-wrapper .s-rate { font-size: 9px; color: #999; }
.inv-plan .matrix-wrapper .text-green-bold { color: #28a745 !important; font-weight: 900 !important; }
.inv-plan .buy-input { width: 40px; padding: 6px 0; border: 1px solid #ccc; border-radius: 4px; text-align: center; font-size: 13px; color: #666; }
.inv-plan .buy-input.is-def { border: 2px solid #28a745; color: #000; font-weight: bold; }
.inv-plan .buy-input:focus { border-color: #007bff; outline: none; background: #e3f2fd; }
.inv-plan .link-stat { cursor: pointer; text-decoration: underline; color: #007bff; }
.inv-plan .link-stat:hover { color: #0056b3; }
.inv-plan .sticky-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 200; background: #fff; border-top: 1px solid #ccc; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.inv-plan .footer-inner { max-width: 768px; margin: 0 auto; padding: 10px; display: flex; gap: 10px; box-sizing: border-box; align-items: center; }
.inv-plan .footer-status-box { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.inv-plan .status-main { font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.inv-plan .status-sub { font-size: 10px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-plan .status-draft { color: #ffc107; }
.inv-plan .status-published { color: #28a745; }
.inv-plan .status-new { color: #007bff; }
.inv-plan .btn-big { padding: 0 20px; height: 44px; border-radius: 6px; border: none; font-size: 14px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.inv-plan .btn-draft { background: #6c757d; color: white; }
.inv-plan .btn-final { background: #28a745; color: white; }
.inv-plan .inv-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: flex-start; padding-top: 80px; }
.inv-plan .inv-modal-box { background: #fff; width: 90%; max-width: 320px; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.inv-plan .inv-modal-header { padding: 15px; background: #f8f9fa; border-bottom: 1px solid #ddd; }
.inv-plan .inv-modal-body { padding: 20px; text-align: center; }
.inv-plan .inv-modal-body .inv-modal-field { margin-bottom: 15px; }
.inv-plan .inv-modal-body .inv-modal-field label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
.inv-plan .inv-modal-body .inv-modal-field input { width: 120px; font-size: 18px; padding: 10px; }
.inv-plan .inv-modal-actions { display: flex; gap: 10px; }
.inv-plan .btn-cancel { background: #e9ecef; color: #333; flex: 1; }
.inv-plan .inv-usage-modal .inv-modal-box { max-width: 500px; }
.inv-plan .inv-usage-modal .hist-summary { display: flex; gap: 10px; margin-bottom: 15px; background: #e9ecef; padding: 10px; border-radius: 4px; }
.inv-plan .inv-usage-modal .hist-summary > div { flex: 1; text-align: center; }
.inv-plan .inv-usage-modal .hist-summary .hist-label { font-size: 10px; color: #666; font-weight: bold; }
.inv-plan .inv-usage-modal .hist-summary .hist-value { font-weight: bold; font-size: 14px; color: #007bff; }
.inv-plan .inv-usage-modal .hist-table { width: 100%; min-width: 0 !important; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
.inv-plan .inv-usage-modal .hist-table thead tr { background: #eee; text-align: center; }
.inv-plan .inv-usage-modal .hist-table th { text-align: left; padding: 3px 2px; width: 65px; font-size: 11px; }
.inv-plan .inv-usage-modal .hist-table th:not(:first-child) { text-align: center; }
.inv-plan .inv-usage-modal .hist-table tbody { text-align: center; }
.inv-plan .inv-usage-modal .hist-table .btn-del { color: white; background: #dc3545; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 10px; padding: 2px 6px; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Purchase */
body.inv-purchase { display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }
.inv-purchase .main-container { flex: 1; display: flex; flex-direction: column; padding: 0; max-width: 768px; margin: 0 auto; width: 100%; overflow: hidden; }
.inv-purchase .workspace { flex: 1 1 auto; display: flex; flex-direction: column; width: 100%; max-width: 768px; margin: 0 auto; background: #fff; border-left: 1px solid #eee; border-right: 1px solid #eee; overflow: hidden; position: relative; }
.inv-purchase .toolbar { flex: 0 0 auto; background: #f8f9fa; border-bottom: 1px solid #ddd; padding: 8px 10px; display: flex; align-items: center; z-index: 90; }
.inv-purchase .controls { display: flex; gap: 8px; align-items: center; width: 100%; flex-wrap: wrap; }
.inv-purchase .btn-act { padding: 0 12px; border-radius: 4px; border: 1px solid #ccc; cursor: pointer; font-size: 12px; background: #fff; white-space: nowrap; height: 32px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; color: #333; text-decoration: none; font-weight: 500; }
.inv-purchase .btn-blue { background: #007bff; color: white; border-color: #0056b3; }
.inv-purchase .plan-select { padding: 0 8px; border-radius: 4px; border: 1px solid #ccc; height: 32px; background: #fff; font-size: 12px; font-weight: bold; color: #333; }
.inv-purchase .matrix-wrapper { flex: 1 1 auto; overflow: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.inv-purchase .matrix-wrapper table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 350px; }
.inv-purchase .matrix-wrapper th, .inv-purchase .matrix-wrapper td { padding: 4px 2px; border-bottom: 1px solid #eee; border-right: 1px solid #eee; text-align: center; vertical-align: top; }
.inv-purchase .matrix-wrapper thead th { position: sticky; top: 0; background: #333; color: #fff; z-index: 20; height: 28px; font-size: 11px; font-weight: normal; vertical-align: middle; }
.inv-purchase .matrix-wrapper thead th:first-child { z-index: 30; left: 0; }
.inv-purchase .matrix-wrapper tbody td:first-child { position: sticky; left: 0; z-index: 15; background: #fff; border-right: 2px solid #ccc; width: 140px; min-width: 140px; max-width: 140px; text-align: left; padding-left: 5px; }
.inv-purchase .footer-outer { flex: 0 0 auto; background: #fff; border-top: 1px solid #ccc; padding: 8px; z-index: 200; width: 100%; box-sizing: border-box; }
.inv-purchase .footer-inner { max-width: 768px; width: 100%; margin: 0 auto; display: flex; flex-direction: row; gap: 8px; align-items: center; }
.inv-purchase #tripDate { width: 110px; height: 36px; box-sizing: border-box; padding: 2px 5px; font-size: 12px; border: 1px solid #ccc; border-radius: 4px; background: #fff; flex-shrink: 0; }
.inv-purchase #tripVendor { flex: 1; height: 36px; box-sizing: border-box; padding: 5px 8px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; min-width: 60px; }
.inv-purchase .btn-invoice { height: 36px; padding: 0 15px; border-radius: 4px; border: 1px solid #ccc; background: #e9ecef; color: #555; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.inv-purchase .btn-invoice.has-file { background: #28a745; color: white; border-color: #28a745; }
.inv-purchase .btn-footer { height: 36px; padding: 0 15px; border-radius: 4px; border: none; font-size: 13px; font-weight: bold; cursor: pointer; color: white; background: #28a745; white-space: nowrap; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inv-purchase .section-header td { background: #e9ecef !important; font-weight: bold; color: #333; text-align: center; padding: 6px; font-size: 12px; text-transform: uppercase; border-top: 2px solid #ccc; }
.inv-purchase .matrix-wrapper tbody.group-odd tr td { background-color: #ffffff; }
.inv-purchase .matrix-wrapper tbody.group-even tr td { background-color: #f8f9fa; }
.inv-purchase .matrix-wrapper .sub-row { display: none; }
.inv-purchase .matrix-wrapper .sub-row.visible { display: table-row; }
.inv-purchase .matrix-wrapper .item-cell { display: flex; flex-direction: column; justify-content: space-between; height: 100%; min-height: 42px; width: 100%; }
.inv-purchase .matrix-wrapper .ic-top { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.inv-purchase .matrix-wrapper .ic-bot { display: flex; justify-content: space-between; width: 100%; align-items: center; margin-top: 2px; }
.inv-purchase .matrix-wrapper .i-name { font-weight: bold; font-size: 13px; color: #333; line-height: 1.2; white-space: normal; flex: 1; }
.inv-purchase .matrix-wrapper .i-arrow { cursor: pointer; font-size: 16px; padding: 4px 8px; line-height: 1; font-weight: bold; margin-left: 5px; color: #555; }
.inv-purchase .matrix-wrapper .i-var { font-size: 11px; color: #666; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 85px; padding-left: 2px; }
.inv-purchase .matrix-wrapper .i-price { font-size: 11px; color: #007bff; cursor: pointer; white-space: nowrap; margin-left: auto; font-weight: 500; padding: 2px 4px; }
.inv-purchase .matrix-wrapper .i-price:active { background: #e3f2fd; border-radius: 3px; }
.inv-purchase .matrix-wrapper .editor-badge { font-size: 9px; background: #e3f2fd; color: #0d47a1; padding: 1px 4px; border-radius: 4px; margin-left: 4px; font-weight: bold; }
.inv-purchase .matrix-wrapper .cell-content { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-height: 44px; padding-bottom: 2px; width: 100%; }
.inv-purchase .matrix-wrapper .top-split { display: flex; justify-content: space-between; width: 44px; font-size: 9px; margin-bottom: 1px; color: #555; font-weight: bold; }
.inv-purchase .matrix-wrapper .top-center { display: flex; justify-content: center; width: 44px; font-size: 9px; margin-bottom: 1px; color: #555; font-weight: bold; }
.inv-purchase .matrix-wrapper .val-inv { color: #28a745; }
.inv-purchase .matrix-wrapper .val-plan { color: #333; }
.inv-purchase .matrix-wrapper .buy-label { font-size: 12px; font-weight: bold; color: #333; cursor: pointer; margin-bottom: 1px; width: 100%; text-align: center; border: 1px solid transparent; border-radius: 3px; }
.inv-purchase .matrix-wrapper .buy-label:active { background-color: #e9ecef; border-color: #ccc; }
.inv-purchase .matrix-wrapper .btn-xfer { color: #007bff; border: 1px solid #cce5ff; background: #e8f4ff; }
.inv-purchase .matrix-wrapper .btn-split { color: #856404; border: 1px solid #ffeeba; background: #fff3cd; }
.inv-purchase .matrix-wrapper .qty-input { width: 44px; padding: 6px 0; border: 1px solid #ccc; border-radius: 4px; text-align: center; font-size: 14px; background: #fff; margin: 0; box-sizing: border-box; -webkit-appearance: none; }
.inv-purchase .matrix-wrapper .qty-input.mismatch { border-color: #dc3545; background-color: #fff5f5; color: #dc3545; font-weight: bold; }
.inv-purchase .matrix-wrapper .qty-input.match { border-color: #28a745; background-color: #f0fff4; color: #155724; font-weight: bold; }
.inv-purchase .matrix-wrapper .qty-input.diff { border-color: #ffc107; background-color: #fffde7; color: #856404; font-weight: bold; }
.inv-purchase .store-col.hidden, .inv-purchase .buy-col-header.hidden, .inv-purchase .buy-col-cell.hidden { display: none; }
.inv-purchase th[data-col^="HOME_"] { background: #fbc02d; color: #000; }
.inv-purchase td[data-col^="HOME_"] { background-color: #fffde7 !important; }
.inv-purchase .inv-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 3000; justify-content: center; align-items: flex-start; padding-top: 80px; }
.inv-purchase .inv-modal-box.compact { background: #fff; width: 260px; padding: 15px; border-radius: 6px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.inv-purchase .inv-modal-box.compact input[type=number] { font-size: 18px; padding: 8px; width: 90px; text-align: center; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; }
.inv-purchase .inv-modal-box.compact .btn-row { display: flex; gap: 10px; justify-content: center; }
.inv-purchase .inv-modal-box.search { background: #fff; width: 90%; max-width: 350px; padding: 15px; border-radius: 6px; max-height: 80vh; display: flex; flex-direction: column; }
.inv-purchase .search-res { flex: 1; overflow-y: auto; margin-top: 10px; border: 1px solid #eee; border-radius: 4px; }
.inv-purchase .search-item { padding: 12px 10px; border-bottom: 1px solid #eee; cursor: pointer; }
.inv-purchase .search-item:active { background: #f0f0f0; }
.inv-purchase .dropdown { position: relative; display: inline-block; }
.inv-purchase .dropdown-content { display: none; position: absolute; background-color: #fff; min-width: 240px; box-shadow: 0 8px 16px rgba(0,0,0,0.2); z-index: 300; border: 1px solid #ddd; border-radius: 4px; padding: 10px; left: 0; max-height: 400px; overflow-y: auto; }
.inv-purchase .dropdown-content.show { display: block; }
.inv-purchase .trip-link { display: block; padding: 8px 6px; font-size: 13px; color: #007bff; text-decoration: none; border-bottom: 1px solid #f0f0f0; }
.inv-purchase .trip-link.pending { color: #d35400; font-weight: bold; }
.inv-purchase .dd-opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 13px; }
.inv-purchase .dd-section { margin-bottom: 10px; }
.inv-purchase .prog-step { margin-bottom: 10px; font-size: 14px; display: flex; align-items: center; }
.inv-purchase .prog-step span { margin-left: 10px; }
.inv-purchase .prog-icon { width: 16px; height: 16px; border-radius: 50%; background: #555; display: inline-block; }
.inv-purchase .prog-icon.active { background: #ffc107; box-shadow: 0 0 5px #ffc107; }
.inv-purchase .prog-icon.done { background: #28a745; }
.inv-purchase .prog-bar-ctn { width: 100%; background: #444; height: 6px; border-radius: 3px; margin-top: 5px; display: none; }
.inv-purchase .prog-bar-fill { height: 100%; background: #28a745; width: 0%; transition: width 0.2s; border-radius: 3px; }
.inv-purchase .process-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9999; justify-content: center; align-items: center; color: white; }
.inv-purchase .process-overlay .process-box { width: 300px; background: #222; padding: 20px; border-radius: 8px; }

/* Count */
.inv-count .store-select { border: none; background: transparent; font-size: 1rem; font-weight: bold; color: #333; text-align: center; cursor: pointer; }
.inv-count .sticky-controls { position: sticky; top: 50px; z-index: 100; background: #fff; border-bottom: 1px solid #ccc; padding: 10px; }
.inv-count .controls-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.inv-count .search-box { flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 4px; height: 36px; box-sizing: border-box; }
.inv-count .storage-toggle { background: #fff; border: 1px solid #007bff; color: #007bff; padding: 0 12px; height: 36px; border-radius: 4px; font-weight: bold; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.inv-count .storage-toggle.active { background: #007bff; color: #fff; }
.inv-count .btn-add { background: #28a745; border: 1px solid #28a745; color: #fff; padding: 0 12px; height: 36px; border-radius: 4px; font-weight: bold; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.inv-count .tabs-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 5px; }
.inv-count .tab-pill { white-space: nowrap; padding: 6px 12px; border-radius: 16px; background: #e9ecef; color: #555; border: 1px solid #ddd; cursor: pointer; font-size: 13px; }
.inv-count .tab-pill.active { background: #007bff; color: white; border-color: #007bff; }
.inv-count .tab-pill.scheduled { border: 2px solid #28a745; color: #155724; font-weight: bold; background: #d4edda; }
.inv-count .tab-pill.active.scheduled { background: #28a745; color: white; border-color: #28a745; }
.inv-count .list-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.inv-count .list-table th { position: sticky; top: 130px; background: #333; color: #fff; z-index: 20; padding: 8px; font-size: 12px; }
.inv-count .list-table .col-name { width: 45%; text-align: left; padding-left: 10px; }
.inv-count .list-table .col-store { width: 27%; text-align: center; }
.inv-count .list-table .col-storage { width: 28%; text-align: center; display: none; }
.inv-count .show-storage .list-table .col-storage { display: table-cell; }
.inv-count .list-table tbody.group-odd td { background-color: #ffffff; }
.inv-count .list-table tbody.group-even td { background-color: #f0f0f0; }
.inv-count .list-table tbody.expanded tr td:first-child { border-left: 6px solid #007bff; }
.inv-count .list-table tbody:not(.expanded) tr td:first-child { border-left: 6px solid transparent; }
.inv-count .list-table tbody td { padding: 8px 2px; border-bottom: 1px solid #ddd; vertical-align: middle; }
.inv-count .list-table .item-cell { display: flex; flex-direction: column; justify-content: center; height: 100%; }
.inv-count .list-table .i-name { font-weight: 800; font-size: 14px; color: #000; margin-bottom: 4px; padding-left: 2px; }
.inv-count .list-table .i-var { font-size: 13px; color: #333; font-weight: 700; display: flex; align-items: center; justify-content: space-between; margin-top: 2px; padding-left: 16px; }
.inv-count .list-table .count-note { font-size: 11px; color: #666; font-style: italic; padding-left: 16px; margin-top: 2px; }
.inv-count .list-table .i-arrow { cursor: pointer; font-size: 14px; padding: 0 5px; }
.inv-count .list-table .sub-row { display: none; }
.inv-count .list-table .sub-row.visible { display: table-row; }
.inv-count .input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; justify-content: center; max-width: 120px; margin: 0 auto; }
.inv-count .qty-input { width: 100%; height: 38px; border: 1px solid #ced4da; border-radius: 4px; text-align: center; font-size: 16px; font-weight: bold; color: #0056b3; background: #fff; padding: 0; box-sizing: border-box; }
.inv-count .qty-input.input-error { border: 2px solid #dc3545; background-color: #ffe6e6; }
.inv-count .u-label { font-size: 10px; color: #d60000; font-weight: 900; text-align: center; margin-top: 2px; line-height: 1.1; text-transform: uppercase; }
.inv-count .cat-row td { background: #e9ecef; color: #495057; font-weight: bold; font-size: 12px; padding: 6px 10px; text-transform: uppercase; border-top: 2px solid #ddd; }
.inv-count .adhoc-header td { background: #d4edda; color: #155724; font-weight: bold; text-transform: uppercase; border-top: 2px solid #28a745; padding: 8px 10px; }
.inv-count .fixed-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 200; pointer-events: none; }
.inv-count .footer-inner { max-width: 768px; margin: 0 auto; background: #fff; border-top: 1px solid #ccc; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); pointer-events: auto; height: 60px; box-sizing: border-box; }
.inv-count .footer-info { flex: 1; font-size: 12px; color: #555; text-align: left; padding-right: 10px; line-height: 1.3; }
.inv-count .footer-buttons { flex: 1; display: flex; gap: 10px; justify-content: flex-end; }
.inv-count .btn-big { padding: 10px 15px; border-radius: 6px; border: none; font-size: 14px; font-weight: bold; cursor: pointer; min-width: 70px; }
.inv-count .btn-draft { background: #6c757d; color: white; }
.inv-count .btn-final { background: #28a745; color: white; }
.inv-count .inv-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 3000; justify-content: center; align-items: flex-start; padding-top: 60px; }
.inv-count .inv-modal-box { background: #fff; width: 90%; max-width: 400px; border-radius: 6px; padding: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.inv-count .search-res { max-height: 300px; overflow-y: auto; margin-top: 10px; border-top: 1px solid #eee; }
.inv-count .search-item { padding: 10px; border-bottom: 1px solid #eee; cursor: pointer; font-size: 14px; }
.inv-count .search-item strong { display: block; color: #333; }
.inv-count .search-item span { font-size: 12px; color: #666; }
.inv-count #alertModal .inv-modal-box { text-align: center; padding: 25px; }
.inv-count .alert-btn { margin: 10px 5px; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: bold; }
.inv-count .btn-alert-fix { background: #007bff; color: white; }
.inv-count .btn-alert-force { background: #6c757d; color: white; }
.inv-count .process-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9999; justify-content: center; align-items: center; }
.inv-count .process-box { background: #fff; width: 90%; max-width: 350px; padding: 25px; border-radius: 8px; text-align: center; }
.inv-count .step-row { display: flex; align-items: center; margin-bottom: 12px; font-size: 14px; color: #777; }
.inv-count .step-icon { width: 20px; height: 20px; border: 2px solid #ddd; border-radius: 50%; margin-right: 10px; }
.inv-count .step-row.active .step-icon { border-color: #007bff; border-top-color: transparent; animation: inv-spin 1s linear infinite; }
.inv-count .step-row.done .step-icon { border-color: #28a745; background: #28a745; }
@keyframes inv-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.inv-count .btn-sm { cursor: pointer; background: #eee; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; }
.inv-count .btn-sm:hover { background: #ddd; }
.inv-count .store-selector-in-content { padding: 12px 15px; background: #fff; border-bottom: 1px solid #e0e0e0; }

/* Rate */
.inv-rate .max-width-container { min-height: calc(100vh - 50px); border-left: 1px solid #ddd; border-right: 1px solid #ddd; display: flex; flex-direction: column; }
.inv-rate .controls { padding: 10px; background: #f8f9fa; border-bottom: 1px solid #ddd; display: flex; gap: 10px; align-items: center; }
.inv-rate .search-box { flex: 1; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.inv-rate .date-picker { padding: 7px; border: 1px solid #ccc; border-radius: 4px; }
.inv-rate .rate-table { width: 100%; border-collapse: collapse; }
.inv-rate .rate-table th { position: sticky; top: 0; background: #333; color: white; padding: 8px 4px; font-size: 11px; z-index: 10; }
.inv-rate .rate-table td { padding: 6px 4px; border-bottom: 1px solid #eee; vertical-align: middle; }
.inv-rate .rate-table .col-name { width: 30%; text-align: left; padding-left: 8px !important; }
.inv-rate .rate-table .col-data { text-align: center; width: 15%; }
.inv-rate .rate-table .col-act { text-align: right; width: 10%; padding-right: 8px !important; }
.inv-rate .inp-qty { width: 100%; max-width: 80px; height: 32px; border: 1px solid #ced4da; border-radius: 4px; text-align: center; font-size: 14px; font-weight: bold; color: #0056b3; background: #fff; padding: 0; box-sizing: border-box; }
.inv-rate .inp-days { width: 100%; max-width: 50px; height: 32px; border: 1px solid #ced4da; border-radius: 4px; text-align: center; font-size: 14px; color: #333; background: #fff; padding: 0; box-sizing: border-box; }
.inv-rate .btn-check { background: #e2e6ea; border: 1px solid #ccc; color: #333; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; }
.inv-rate .btn-save { background: #28a745; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; display: none; margin-left: 5px; }
.inv-rate .row-changed .btn-save { display: inline-block; }
.inv-rate .row-changed .inp-qty { border: 2px solid #28a745; background: #e8f5e9; }
.inv-rate .item-name-big { font-weight: bold; color: #000; font-size: 14px; display: block; }
.inv-rate .inv-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: center; }
.inv-rate .inv-modal-box { background: #fff; width: 90%; max-width: 400px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); overflow: hidden; }
.inv-rate .modal-header { padding: 15px; background: #f8f9fa; border-bottom: 1px solid #ddd; font-weight: bold; display: flex; justify-content: space-between; }
.inv-rate .modal-body { padding: 20px; font-size: 14px; line-height: 1.6; }
.inv-rate .math-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #eee; }
.inv-rate .math-total { display: flex; justify-content: space-between; padding: 10px 0; border-top: 2px solid #333; font-weight: bold; margin-top: 5px; font-size: 16px; }
.inv-rate .btn-close { border: none; background: none; font-size: 18px; cursor: pointer; }
.inv-rate .sales-info { background: #e3f2fd; padding: 10px; margin-top: 10px; border-radius: 4px; color: #0d47a1; font-size: 13px; }

/* ========== CM MODULE ========== */
.cm-container { max-width: 768px; margin: 0 auto; padding: 15px; }
.cm-container .box { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.cm-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cm-table th, .cm-table td { padding: 8px; text-align: center; border-bottom: 1px solid #eee; vertical-align: middle; }
.cm-table th { background: #f9f9f9; color: #555; font-size: 0.85rem; }
.cm-table .neg { color: #c62828; }
.cm-table .pos { color: #2e7d32; }
.cm-container .min-w { width: 1%; white-space: nowrap; }
.cm-container .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; align-items: start; }
.cm-container .form-item label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 0.9rem; color: #555; }
.cm-container select, .cm-container input[type="number"], .cm-container textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; box-sizing: border-box; }
.cm-container .grand-total { text-align: center; margin-top: 20px; font-size: 1.1rem; line-height: 1.6; }
.cm-container .big-num { font-weight: bold; color: #333; }
.cm-container .btn-primary { width: 100%; padding: 12px; font-size: 1rem; font-weight: bold; color: white; border: none; border-radius: 6px; cursor: pointer; }
.cm-container .sticky-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 3000; background: #fff; border-top: 1px solid #ccc; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.cm-container .footer-inner { max-width: 768px; margin: 0 auto; padding: 10px 15px; display: flex; justify-content: center; gap: 10px; }
.cm-container .calc-toggle { background: #444; border: 1px solid #666; color: white; padding: 8px 15px; cursor: pointer; border-radius: 20px; font-size: 0.9rem; }
.cm-container .calc-panel { display: none; position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); background: white; border: 1px solid #ccc; padding: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); z-index: 3001; color: black; border-radius: 8px; width: 280px; font-size: 0.9rem; }
.cm-container .calc-panel input { width: 60px; text-align: right; padding: 5px; font-size: 1rem; }
.cm-container .calc-panel table { width: 100%; }
.cm-container .line-total { font-size: 0.8rem; color: #777; text-align: right; }
.cm-list .container { max-width: 768px; margin: 20px auto; padding: 0 15px; }
.cm-list .box { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); overflow-x: auto; }
.cm-list .list-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cm-list .list-table th, .cm-list .list-table td { padding: 10px; border-bottom: 1px solid #eee; vertical-align: middle; text-align: center; }
.cm-list .list-table th { background: #f9f9f9; color: #555; font-weight: 600; }
.cm-list .list-table .neg { color: #c62828; font-weight: bold; }
.cm-list .list-table .pos { color: #2e7d32; font-weight: bold; }
.cm-list .list-table .note-text { text-align: left; color: #555; font-size: 0.9rem; }

/* ========== AUDIT MODULE ========== */
.page-audit .audit-header { background: white; padding: 10px 15px; border-bottom: 1px solid #ddd; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 2000; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.page-audit .filter-group { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; flex-grow: 1; }
.page-audit .action-group { display: flex; gap: 5px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.page-audit .btn-fixed { width: 100px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: bold; border-radius: 4px; white-space: nowrap; cursor: pointer; border: 1px solid #ccc; text-decoration: none; box-sizing: border-box; }
.page-audit .btn-static { background: #eee; color: #333; cursor: default; }
.page-audit .btn-refresh { background: #2196F3; color: white; border: none; }
.page-audit .btn-save { background: #4CAF50; color: white; border: none; }
.page-audit .btn-store { background: #607d8b; color: white; border: none; width: 40px; }
.page-audit .btn-refresh:hover, .page-audit .btn-save:hover, .page-audit .btn-store:hover { opacity: 0.9; }
.page-audit .table-container { width: 100%; overflow-x: auto; max-height: 70vh; background: #fff; border-top: 1px solid #ccc; }
.page-audit .audit-table { border-collapse: separate; border-spacing: 0; font-size: 0.85rem; min-width: 1000px; }
.page-audit .audit-table th, .page-audit .audit-table td { border: 1px solid #ccc; padding: 4px 6px; text-align: center; white-space: nowrap; }
.page-audit .audit-table thead th { position: sticky; top: 0; background: #A9D08E; color: black; z-index: 1000; height: 45px; vertical-align: bottom; border-bottom: 1px solid #555; }
.page-audit .audit-table .sticky-1 { position: sticky; left: 0; background: #fff; z-index: 900; border-right: 1px solid #eee; width: 100px; min-width: 100px; font-weight: bold; }
.page-audit .audit-table .sticky-2 { position: sticky; left: 100px; background: #fff; z-index: 900; border-right: 2px solid #aaa; width: 80px; min-width: 80px; }
.page-audit .audit-table thead th.sticky-1, .page-audit .audit-table thead th.sticky-2 { z-index: 1500; background: #A9D08E; color: black; }
.page-audit .audit-table tfoot th.sticky-1, .page-audit .audit-table tfoot th.sticky-2, .page-audit .audit-table tfoot td.sticky-1, .page-audit .audit-table tfoot td.sticky-2 { z-index: 1500; background: #eee; }
.page-audit .audit-table tr:hover td { background-color: #e3f2fd !important; }
.page-audit .audit-table tr.selected td { background-color: #fff9c4 !important; }
.page-audit .audit-table .os-alert { color: red; font-weight: bold; background-color: #ffebee; }
.page-audit .audit-table .audit-check { transform: scale(1.3); cursor: pointer; }
.page-audit .audit-table .user-cell { font-size: 0.75rem; color: #666; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.page-audit .audit-table tfoot th, .page-audit .audit-table tfoot td { position: sticky; bottom: 0; background: #eee; font-weight: bold; border-top: 2px solid #666; z-index: 800; padding: 10px 5px; }
.page-audit .sticky-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 3000; background: #fff; border-top: 1px solid #ccc; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.page-audit .footer-inner { width: 100%; padding: 10px 15px; display: flex; justify-content: center; gap: 10px; box-sizing: border-box; }
.page-audit .calc-toggle { background: #444; border: 1px solid #666; color: white; padding: 8px 15px; cursor: pointer; border-radius: 20px; font-size: 0.9rem; }
.page-audit .calc-panel { display: none; position: fixed; bottom: 55px; left: 10px; background: white; border: 1px solid #333; padding: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 3001; color: black; border-radius: 8px; width: 160px; font-size: 0.85rem; }
.page-audit .calc-panel input { width: 40px; text-align: right; padding: 3px; font-size: 0.9rem; }
.page-audit .calc-panel table { width: 100%; }
.page-audit .line-total { font-size: 0.75rem; color: #777; text-align: right; }

/* ========== SQUARE MODULE ========== */
.page-square .max-width-container { max-width: 900px; margin: 0 auto; background-color: #fff; min-height: calc(100vh - 50px); box-shadow: 0 0 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; border-left: 1px solid #dee2e6; border-right: 1px solid #dee2e6; }
.page-square .sticky-toolbar { position: sticky; top: 50px; z-index: 90; background: #fff; border-bottom: 1px solid #dee2e6; padding: 10px; width: 100%; max-width: 900px; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; box-sizing: border-box; }
.page-square .nav-btn { background: #e9ecef; border: 1px solid #ced4da; border-radius: 4px; height: 34px; width: 34px; font-weight: bold; color: #495057; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: background 0.2s; }
.page-square .nav-btn:hover { background: #dde2e6; }
.page-square .flatpickr-input { text-align: center; border: 1px solid #ced4da; border-radius: 4px; height: 32px; width: 190px; padding: 0 10px; font-size: 13px; cursor: pointer; background: #fff; }
.page-square .matrix-wrapper { width: 100%; overflow-x: auto; display: flex; justify-content: center; padding-top: 10px; padding-bottom: 30px; }
.page-square .matrix-wrapper table { border-collapse: separate; border-spacing: 0; font-size: 13px; width: auto; border-top: 1px solid #dee2e6; }
.page-square .matrix-wrapper th, .page-square .matrix-wrapper td { padding: 8px 10px; border-bottom: 1px solid #dee2e6; border-right: 1px solid #dee2e6; vertical-align: middle; }
.page-square .matrix-wrapper th:first-child, .page-square .matrix-wrapper td:first-child { text-align: right; width: 220px; max-width: 220px; min-width: 150px; background: #fff; border-right: 2px solid #ced4da; font-weight: 600; color: #343a40; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: sticky; left: 0; z-index: 2; }
.page-square .matrix-wrapper thead th { background: #f8f9fa; color: #333; height: 35px; border-bottom: 2px solid #dee2e6; text-align: right; font-weight: bold; }
.page-square .matrix-wrapper .section-row td { background: #e9ecef; font-weight: bold; text-align: center !important; text-transform: uppercase; color: #495057; padding: 10px; border-top: 1px solid #dee2e6; letter-spacing: 0.5px; }
.page-square .matrix-wrapper .cat-row td { background: #f1f3f5; color: #495057; font-weight: bold; text-align: center !important; padding: 8px; font-size: 12px; border-top: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6; }
.page-square .modal, .page-square .sq-modal { display: none; position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.page-square .modal-content, .page-square .sq-modal-content { background-color: #fefefe; margin: 5% auto; padding: 0; border: 1px solid #888; width: 90%; max-width: 700px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: sq-slideDown 0.3s; }
.page-square .modal-header { padding: 15px 20px; background: #343a40; color: white; border-top-left-radius: 8px; border-top-right-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.page-square .modal-footer { padding: 15px 20px; background: #f8f9fa; text-align: right; font-weight: bold; border-top: 1px solid #dee2e6; }
@keyframes sq-slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.page-square .sq-modal-header { padding: 15px 20px; background: #343a40; color: white; border-top-left-radius: 8px; border-top-right-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.page-square .m-row { display: flex; padding: 12px 20px; border-bottom: 1px solid #eee; align-items: center; cursor: pointer; transition: background 0.1s; }
.page-square .m-row:hover { background: #f8f9fa; }
.page-square .m-time { width: 60px; font-weight: bold; color: #888; }
.page-square .m-desc { flex: 1; }
.page-square .m-amt { width: 90px; text-align: right; font-weight: bold; }
.page-square .sq-modal-footer { padding: 15px 20px; background: #f8f9fa; text-align: right; font-weight: bold; border-top: 1px solid #dee2e6; }
.page-square .nested-refund { background-color: #fff5f5; border-left: 4px solid #dc3545; padding-left: 15px; }
.page-square .dt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 10px; }
.page-square .dt-table th { text-align: left; border-bottom: 1px solid #ddd; padding: 5px; color: #555; font-size: 0.8rem; background: #f9f9f9; }
.page-square .dt-table td { padding: 8px 5px; border-bottom: 1px solid #f5f5f5; color: #333; }
.page-square .sec-title { font-size: 0.9rem; text-transform: uppercase; color: #888; border-bottom: 2px solid #eee; margin-top: 20px; margin-bottom: 10px; padding-bottom: 5px; font-weight: bold; }
.page-square .raw-btn { background: #f8f9fa; border: 1px solid #ddd; color: #007bff; padding: 8px 15px; cursor: pointer; font-size: 0.9rem; width: 100%; text-align: left; font-weight: bold; border-radius: 4px; }
.page-square .raw-content { background: #fff; margin: 5% auto; width: 90%; max-width: 800px; height: 80vh; display: flex; flex-direction: column; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.3); }
.page-square .raw-header { padding: 15px; background: #212529; color: white; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-radius: 8px 8px 0 0; }
.page-square-tx .toolbar { max-width: 900px; margin: 20px auto 0; padding: 15px; background: #fff; border: 1px solid #dee2e6; border-radius: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.page-square-tx .container { max-width: 900px; margin: 20px auto; background: white; border: 1px solid #dee2e6; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow: hidden; }
.page-square-tx .row { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid #f1f3f5; transition: background 0.1s; }
.page-square-tx .row:hover { background: #f8f9fa; }
.page-square-tx .col-time { width: 60px; font-weight: bold; color: #6c757d; font-size: 0.9rem; }
.page-square-tx .col-desc { flex: 1; font-size: 0.95rem; color: #007bff; cursor: pointer; font-weight: 500; }
.page-square-tx .col-desc:hover { text-decoration: underline; color: #0056b3; }
.page-square-tx .col-amt { width: 100px; text-align: right; font-weight: 600; color: #343a40; }
.page-square-tx .sq-link { color: #6c757d; text-decoration: none; font-size: 0.8rem; border: 1px solid #dee2e6; padding: 2px 6px; border-radius: 3px; background: #fff; cursor: pointer; }
.page-square-tx .sq-link:hover { background: #e9ecef; }
.page-square-tx .total-bar { background: #e9ecef; padding: 15px; text-align: right; font-weight: bold; font-size: 1.1rem; color: #343a40; border-top: 1px solid #dee2e6; }
.page-square-tx .sq-modal { display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.page-square-tx .sq-modal-content { background-color: #fefefe; margin: 3% auto; width: 95%; max-width: 750px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: sq-slideDown 0.3s; display: flex; flex-direction: column; max-height: 90vh; }
.page-square-tx .m-header { padding: 15px 20px; background: #343a40; color: white; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; }
.page-square-tx .m-body { padding: 20px; overflow-y: auto; flex: 1; background: #fff; }
.page-square-tx .close-btn { color: #ccc; font-size: 24px; cursor: pointer; font-weight: bold; }
.page-square-tx .close-btn:hover { color: white; }
.page-dark .controls { background: #2d2d2d; padding: 20px; border-radius: 8px; display: grid; gap: 15px; border: 1px solid #444; }
.page-dark .control-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-dark .btn { padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; color: white; transition: opacity 0.2s; font-size: 0.9rem; }
.page-dark .btn-green { background: #28a745; }
.page-dark .btn-blue { background: #007bff; }
.page-dark .btn-red { background: #d32f2f; }
.page-dark .terminal-window { background: #000; border: 1px solid #444; border-radius: 4px; height: 500px; overflow-y: auto; padding: 15px; margin-top: 20px; font-family: monospace; font-size: 13px; }
.page-dark .log-line { margin-bottom: 6px; border-bottom: 1px solid #111; padding-bottom: 4px; }
.page-dark .log-info { color: #81d4fa; }
.page-dark .log-success { color: #69f0ae; }
.page-dark .log-warn { color: #ffab40; }
.page-dark .log-err { color: #ff5252; }
.page-dark .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; }
.page-dark .modal-content { background: #222; width: 90%; height: 90%; margin: 2% auto; padding: 20px; border-radius: 8px; display: flex; flex-direction: column; }
.page-dark .modal-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.page-dark .modal-cols { display: flex; gap: 20px; flex: 1; overflow: hidden; }
.page-dark .json-col { flex: 1; display: flex; flex-direction: column; }
.page-dark .modal-content textarea { flex: 1; background: #111; color: #0f0; font-family: monospace; padding: 10px; border: 1px solid #444; resize: none; }

/* ========== GELATO MODULE ========== */
.page-gelato .max-width-container { max-width: 768px; margin: 0 auto; background-color: #fff; min-height: 100vh; position: relative; display: flex; flex-direction: column; }
.page-gelato .controls-row { padding: 10px; background: #fff; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.page-gelato .week-select { font-size: 14px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; color: #333; max-width: 200px; }
.page-gelato .table-scroll-wrapper { flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; width: 100%; }
.page-gelato .plan-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.page-gelato .plan-table th.col-drag, .page-gelato .plan-table td.td-drag { position: sticky; left: 0; width: 30px; min-width: 30px; z-index: 10; background-color: #fff; border-right: 1px solid #eee; }
.page-gelato .plan-table th.col-name, .page-gelato .plan-table td.td-name { position: sticky; left: 30px; width: 160px; min-width: 160px; max-width: 160px; z-index: 10; background-color: #fff; border-right: 2px solid #ddd; box-shadow: 2px 0 5px rgba(0,0,0,0.05); }
.page-gelato .plan-table th { background: #555; color: #fff; padding: 8px 4px; font-size: 11px; text-align: center; white-space: nowrap; }
.page-gelato .col-inv, .page-gelato .col-stock, .page-gelato .col-sugg { width: 34px; min-width: 34px; max-width: 34px; }
.page-gelato .col-stock { background: #e3f2fd; color: #0d47a1; }
.page-gelato .col-sugg { background: #f0f0f0; color: #333; font-weight: bold; }
.page-gelato .col-inv { background: #fff; }
.page-gelato .col-day { background: #e3f2fd; color: #0d47a1; border-left: 1px solid #fff; min-width: 60px; }
.page-gelato .tr-calc td { background: #d6d8db !important; font-weight: bold; border-bottom: 2px solid #999; }
.page-gelato .tr-item { border-bottom: 1px solid #eee; height: 50px; }
.page-gelato .tr-item:hover { background-color: #f9f9f9; }
.page-gelato .td-cell { padding: 0 4px; vertical-align: middle; text-align: center; font-size: 13px; border-bottom: 1px solid #eee; }
.page-gelato .td-name { text-align: left; font-weight: 600; padding-left: 5px !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-gelato .qty-input { width: 100%; height: 36px; border: 1px solid #ccc; border-radius: 4px; text-align: center; font-size: 15px; font-weight: bold; background: #fff; margin: 5px 0; }
.page-gelato .fixed-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 200; pointer-events: none; }
.page-gelato .footer-inner { max-width: 768px; margin: 0 auto; background: #fff; border-top: 1px solid #ccc; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); pointer-events: auto; height: 60px; box-sizing: border-box; }
.page-gelato .day-picker-btn { padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.page-gelato .day-picker-dropdown { position: absolute; top: 100%; right: 0; width: 150px; background: #fff; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: none; z-index: 300; margin-top: 5px; padding: 5px; }
.page-gelato .day-opt { padding: 8px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f0f0f0; }
.page-gelato .count-info-banner { background: #e8f5e9; color: #1b5e20; padding: 8px; font-size: 12px; text-align: center; border-bottom: 1px solid #c8e6c9; font-weight: bold; display: none; }
.page-gelato .tr-calc .td-drag, .page-gelato .tr-calc .td-name { background-color: #d6d8db !important; }
.page-gelato .tr-total td { background: #545b62 !important; color: #fff; font-weight: bold; border-top: 2px solid #333; }
.page-gelato .tr-total .td-drag, .page-gelato .tr-total .td-name { background-color: #545b62 !important; color: #fff; }
.page-gelato .tr-item.dragging td { background: #e3f2fd !important; }
.page-gelato .tr-whitebase td { background-color: #e8f5e9 !important; }
.page-gelato .drag-handle { cursor: grab; font-size: 16px; color: #ccc; font-weight: bold; padding: 5px; text-align: center; height: 100%; display: flex; align-items: center; justify-content: center; }
.page-gelato .qty-input:focus { background: #e3f2fd; border-color: #007bff; }
.page-gelato .qty-input:disabled { background: #eee; color: #aaa; border: none; }
.page-gelato .stock-good { color: #000; cursor: pointer; text-decoration: underline; }
.page-gelato .stock-red { color: red; font-weight: bold; cursor: pointer; text-decoration: underline; }
.page-gelato .sugg-link { cursor: pointer; text-decoration: underline; }
.page-gelato .sugg-red { color: red; font-weight: bold; }
.page-gelato .sugg-green { color: green; font-weight: bold; }
.page-gelato .hidden-col { display: none !important; }
.page-gelato .sect-header { position: sticky; left: 0; z-index: 15; background: #eee; font-weight: bold; padding: 5px 10px; font-size: 12px; color: #555; text-transform: uppercase; border-top: 2px solid #ddd; }
.page-gelato .footer-info { flex: 1; font-size: 11px; color: #666; text-align: left; padding-right: 10px; line-height: 1.2; }
.page-gelato .footer-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.page-gelato .btn-big { padding: 8px 12px; border-radius: 6px; border: none; font-size: 13px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.page-gelato .btn-order { background: #17a2b8; color: white; }
.page-gelato .btn-draft { background: #6c757d; color: white; }
.page-gelato .btn-pub { background: #28a745; color: white; }
.page-gelato .gelato-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 3000; justify-content: center; align-items: center; }
.page-gelato .gelato-modal-box { background: #fff; width: 90%; max-width: 500px; max-height: 90vh; overflow-y: auto; border-radius: 6px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.page-gelato .order-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; align-items: center; border-bottom: 1px solid #eee; padding: 8px 0; font-size: 13px; }
.page-gelato .order-row input { width: 100%; padding: 5px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }
.page-gelato .stat-box { background: #eee; border-radius: 4px; padding: 10px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 50px; }
.page-gelato .stat-label { font-size: 11px; color: #555; margin-bottom: 3px; font-weight: bold; }
.page-gelato .stat-val { font-weight: bold; font-size: 15px; color: #333; }
.page-gelato .hist-input-group { display: flex; gap: 10px; margin-bottom: 15px; align-items: center; }
.page-gelato .hist-table th, .page-gelato .hist-table td { text-align: center; padding: 4px; border-bottom: 1px solid #eee; font-size: 12px; }
.page-gelato .qty-input[readonly] { background-color: #e8f5e9; color: #333; border-color: #ccc; }
.page-gelato .input-error { color: red !important; border-color: red !important; }
.page-gelato .text-error { color: red !important; font-weight: bold; }
.page-gelato-view .plan-table th.col-name, .page-gelato-view .plan-table td.td-name { position: sticky; left: 0; width: 140px; min-width: 140px; max-width: 140px; }
.page-gelato-view .today-col { border-left: 2px solid #007bff; border-right: 2px solid #007bff; background-color: rgba(0,123,255,0.05); }
.page-gelato-view .today-header { background: #007bff !important; color: #fff; font-weight: bold; }
.page-gelato-view .qty-box { width: 36px; height: 36px; line-height: 36px; margin: 0 auto; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; font-size: 15px; cursor: pointer; user-select: none; transition: background 0.1s; }
.page-gelato-view .status-0 { background: #fff; color: #333; }
.page-gelato-view .status-1 { background: #ffc107; color: #000; border-color: #e0a800; }
.page-gelato-view .status-2 { background: #28a745; color: #fff; border-color: #218838; }
.page-gelato-view .max-width-container { max-width: 768px; margin: 0 auto; background-color: #fff; min-height: 100vh; position: relative; display: flex; flex-direction: column; }
.page-gelato-view .controls-row { padding: 10px; background: #fff; border-bottom: 1px solid #eee; display: flex; justify-content: center; align-items: center; }
.page-gelato-view .week-select { font-size: 14px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; color: #333; max-width: 200px; }
.page-gelato-view .week-display { font-size: 16px; font-weight: bold; color: #28a745; }
.page-gelato-view .table-scroll-wrapper { flex: 1; overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; width: 100%; }
.page-gelato-view .plan-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.page-gelato-view .tr-item { border-bottom: 1px solid #eee; height: 50px; }
.page-gelato-view .td-cell { padding: 0 4px; vertical-align: middle; text-align: center; font-size: 13px; border-bottom: 1px solid #eee; }
.page-gelato-view .legend-bar { display: flex; gap: 15px; justify-content: center; padding: 10px; background: #fff; border-bottom: 1px solid #eee; font-size: 12px; font-weight: 600; color: #555; }
.page-gelato-view .legend-item { display: flex; align-items: center; gap: 5px; }
.page-gelato-view .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #ccc; }
.page-gelato-view .dot.white { background: #fff; }
.page-gelato-view .dot.orange { background: #ffc107; border-color: #ffb300; }
.page-gelato-view .dot.green { background: #28a745; border-color: #218838; }
.page-gelato-view .plan-table th.col-name { color: #333 !important; font-weight: bold; }
.page-gelato-view .td-name { cursor: pointer; color: #0056b3; }
.page-gelato-view .qty-box.locked { pointer-events: none; opacity: 0.7; border-color: #ccc; }
.page-gelato-view .fixed-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 200; pointer-events: none; }
.page-gelato-view .footer-inner { max-width: 768px; margin: 0 auto; background: #fff; border-top: 1px solid #ccc; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); pointer-events: auto; height: 60px; box-sizing: border-box; }
.page-gelato-view .footer-info { flex: 1; font-size: 11px; color: #666; text-align: left; padding-right: 10px; line-height: 1.2; }
.page-gelato-view .btn-submit { background: #28a745; color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; font-size: 14px; cursor: pointer; display: none; }
.page-gelato-view .btn-submit:hover { background: #218838; }
.page-gelato-view .modal-title { margin-top: 0; font-size: 18px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
.page-gelato-view .ing-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.page-gelato-view .ing-val { font-weight: bold; }
.page-gelato-view .section-header { font-size: 12px; font-weight: bold; color: #555; background: #eee; padding: 4px 8px; margin: 10px -20px 5px -20px; text-transform: uppercase; }
.page-gelato-view .tr-prep { background-color: #fff8e1; border-bottom: 2px solid #ccc; }
.page-gelato-view .tr-prep .td-name { font-style: italic; color: #d35400; text-decoration: underline; }
.page-gelato-view .prep-highlight { color: #d35400; font-weight: bold; }
.page-gelato-view .ing-scaled { background-color: #e8f5e9; color: #2e7d32; font-weight: bold; padding: 0 4px; border-radius: 3px; }
.page-gelato-view .batch-box { border: 1px solid #ddd; border-radius: 6px; padding: 10px; margin-bottom: 15px; }
.page-gelato-view .batch-box.blue-box { background-color: #e3f2fd; border-color: #b3d7ff; }
.page-gelato-view .batch-box.white-box { background-color: #fff; border-color: #ccc; }
.page-gelato-view .box-title { font-weight: bold; font-size: 14px; margin-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 5px; }
.page-gelato-view .debug-list { font-family: monospace; font-size: 12px; background: #f8f9fa; padding: 10px; border: 1px solid #eee; max-height: 200px; overflow-y: auto; }
.page-gelato-view .debug-item { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed #ddd; }
.page-gelato-view .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.page-gelato-view .btn-modal-close { flex: 1; padding: 12px; background: #ddd; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; }
.page-gelato-view .btn-modal-confirm { flex: 1; padding: 12px; background: #007bff; color: white; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; display: none; }
.page-gelato-view .gelato-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 3000; justify-content: center; align-items: center; }
.page-gelato-view .gelato-modal-box { background: #fff; width: 90%; max-width: 400px; max-height: 80vh; overflow-y: auto; border-radius: 8px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

/* ========== COUNT MODULE (form) ========== */
.page-count .store-selector { font-size: 1rem; font-weight: bold; border: none; background: transparent; text-align: center; text-align-last: center; width: 150px; cursor: pointer; color: #000; }
.page-count .count-group { background: #fff; padding: 15px; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.page-count .input-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 5px; flex-wrap: wrap; }
.page-count .input-row label { font-weight: bold; flex: 1; }
.page-count .input-row input { width: 100px; padding: 8px; font-size: 16px; text-align: right; border: 1px solid #ddd; border-radius: 4px; transition: border 0.3s; }
.page-count .total-display { font-size: 1.2rem; font-weight: bold; text-align: right; color: var(--primary); margin-top: 10px; }
.page-count .os-display { text-align: center; padding: 10px; margin: 10px 0; font-weight: bold; border-radius: 4px; }
.page-count .os-good { background: #e8f5e9; color: #2e7d32; }
.page-count .os-bad { background: #ffebee; color: #c62828; }
.page-count .sticky-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 100; background: #fff; border-top: 1px solid #ccc; }
.page-count .footer-inner { max-width: 768px; margin: 0 auto; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; }
.page-count .tip-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9rem; }
.page-count .tip-table th { text-align: left; border-bottom: 2px solid #eee; padding: 5px; color: #555; }
.page-count .tip-table td { padding: 8px 5px; border-bottom: 1px solid #f9f9f9; }
.page-count .tip-input { width: 60px; padding: 5px; text-align: center; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; background: #f9f9f9; color: #555; }
.page-count .manager-controls { display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 10px; }
.page-count .manager-date { width: 140px; padding: 6px; font-size: 0.9rem; text-align: center; border: 1px solid #ccc; border-radius: 4px; height: 35px; box-sizing: border-box; }
.page-count .manager-select { padding: 6px; font-size: 0.9rem; height: 35px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.page-count .main-container { display: flex; flex-direction: column; }
.page-count .warning-text { color: red; font-size: 0.8rem; display: none; margin-top: 2px; text-align: right; width: 100%; }
.page-count .changed-count { border: 2px solid orange !important; background: #fffde7; }
.page-count .safe-empty-check { display: none; width: 100%; text-align: right; font-size: 0.85rem; color: #ef6c00; margin-top: 4px; }
.page-count .safe-empty-check input { width: auto; margin-right: 5px; }
.page-count .tip-money { font-weight: bold; color: #2e7d32; text-align: right; }
.page-count .trainee-badge { font-size: 0.75rem; background: #ffecb3; padding: 2px 5px; border-radius: 3px; margin-left: 5px; color: #666; }
.page-count .sq-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.page-count .sq-toggle-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #007bff; }
.page-count .sq-hidden-content { display: none; margin-top: 15px; padding-top: 10px; border-top: 1px dashed #ccc; }
.page-count .sq-locked { background-color: #f9f9f9; color: #555; border-color: #ddd; }
.page-count .header-right-group { display: flex; align-items: center; gap: 8px; }
.page-count .sync-info { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.7rem; color: #666; line-height: 1.2; text-align: right; }
.page-count .save-status { font-size: 0.8rem; color: #666; font-style: italic; }
.page-count .btn-sm { padding: 8px 12px; font-size: 0.9rem; font-weight: bold; border-radius: 4px; width: 90px; }

/* ========== COUNT VERIFY ========== */
.page-verify .main-container { display: flex; flex-direction: column; }
.page-verify .verify-box { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); margin-bottom: 20px; }
.page-verify .data-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.page-verify .data-table td { padding: 12px 5px; border-bottom: 1px solid #eee; font-size: 1rem; }
.page-verify .label { font-weight: bold; color: #555; }
.page-verify .val { text-align: right; font-weight: bold; font-size: 1.1rem; color: #333; }
.page-verify .success-box { background: #e8f5e9; color: #2e7d32; padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); font-size: 1.1rem; }
.page-verify .error-box { background: #ffebee; color: #c62828; padding: 15px; border-radius: 8px; text-align: center; font-weight: bold; margin-bottom: 20px; border: 1px solid #ffcdd2; }
.page-verify .warn-box { background: #fff3e0; color: #ef6c00; padding: 15px; border-radius: 8px; border: 1px solid #ffe0b2; margin-top: 20px; text-align: left; }
.page-verify .btn-resubmit { background: #d32f2f; color: white; width: 100%; padding: 15px; font-size: 1.1rem; border: none; border-radius: 6px; cursor: pointer; margin-top: 10px; font-weight: bold; }
.page-verify .btn-resubmit:hover { background: #b71c1c; }
.page-verify .recovery-table { width: 100%; font-size: 0.8rem; border: 1px solid #ddd; margin-top: 10px; border-collapse: collapse; background: #fff; color: #000; }
.page-verify .recovery-table th { background: #f5f5f5; text-align: center; padding: 6px; border: 1px solid #ddd; }
.page-verify .recovery-table td { padding: 6px; border: 1px solid #ddd; }
.page-verify .rec-label { font-weight: bold; color: #555; }
.page-verify .rec-val { text-align: right; font-family: monospace; font-weight: bold; }
.page-verify .mid-border { border-right: 2px solid #aaa !important; }
.page-verify .btn-row { display: flex; gap: 10px; margin-top: 25px; }
.page-verify .btn-flex { flex: 1; text-align: center; padding: 15px; text-decoration: none; border-radius: 6px; font-weight: bold; color: white; font-size: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.page-verify .btn-dash { background: #555; }
.page-verify .btn-clock { background: #ef6c00; }

/* ========== INVENTORY SETTINGS ========== */
.page-inv-settings .tab-content { display: none; padding: 10px; flex-grow: 1; }
.page-inv-settings .tab-content.active { display: block; }
.page-inv-settings .matrix-container { overflow-x: auto; border: 1px solid #ccc; background: #fff; -webkit-overflow-scrolling: touch; }
.page-inv-settings .matrix-table th:first-child { width: 30px; background: #333; color: #fff; padding: 0; vertical-align: middle; }
.page-inv-settings .matrix-table th:not(:first-child) { min-width: 150px; width: auto; background: #333; color: #fff; font-size: 12px; padding: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-inv-settings .matrix-table td:first-child { width: 30px; background: #f4f4f4; border-right: 2px solid #666; padding: 0; vertical-align: middle; text-align: center; position: sticky; left: 0; z-index: 10; border-bottom: 2px solid #666; }
.page-inv-settings .matrix-table td { border-bottom: 2px solid #666; border-right: 1px solid #ddd; vertical-align: top; padding: 8px; }
.page-inv-settings .config-cell { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.page-inv-settings .del-day-chk { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 9px; background: #fff; border: 1px solid #ccc; border-radius: 2px; height: 24px; cursor: pointer; user-select: none; }
.page-inv-settings .del-day-chk.checked { background: #333; color: #fff; border-color: #333; }
.page-inv-settings .inv-settings-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; justify-content: center; align-items: flex-start; padding-top: 50px; }
.page-inv-settings .inv-settings-modal-box { background: #fff; width: 95%; max-width: 400px; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.2); display: flex; flex-direction: column; max-height: 90vh; }
.page-inv-settings .item-controls { padding: 10px; background: #f1f3f5; border-bottom: 1px solid #ddd; display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.page-inv-settings .group-header { background: #e9ecef; padding: 8px 10px; font-weight: bold; font-size: 12px; color: #333; border-bottom: 1px solid #ddd; cursor: pointer; display: flex; justify-content: space-between; user-select: none; }
.page-inv-settings .item-row { display: flex; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee; background: #fff; text-align: left; }
.page-inv-settings .hist-table { width: 100%; min-width: 600px; border-collapse: collapse; table-layout: fixed; }
.page-inv-settings .hist-table th { background: #f1f1f1; color: #555; font-size: 11px; text-align: left; padding: 6px; border-bottom: 2px solid #ddd; }
.page-inv-settings .hist-table td { padding: 6px; border-bottom: 1px solid #eee; font-size: 12px; vertical-align: middle; }
.page-inv-settings .col-date { width: 110px; }
.page-inv-settings .col-store { width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-inv-settings .col-type { width: 90px; }
.page-inv-settings .col-info { width: auto; }
.page-inv-settings .col-act { width: 40px; text-align: center; }
.page-inv-settings .link-act { font-weight: bold; color: #007bff; text-decoration: underline; cursor: pointer; margin-right: 10px; }
.page-inv-settings .link-act.sec { color: #28a745; }
.page-inv-settings .ts-label { display: block; font-size: 9px; color: #999; margin-top: 2px; }
.page-inv-settings .btn-header { background: #007bff; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: bold; text-decoration: none; display: inline-block; }
.page-inv-settings .main-container { background: #fff; min-height: calc(100vh - 50px); border-left: 1px solid #ddd; border-right: 1px solid #ddd; display: flex; flex-direction: column; position: relative; padding: 0; }
.page-inv-settings .vertical-text { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: bold; font-size: 12px; color: #555; height: 100px; width: 100%; display: flex; align-items: center; justify-content: center; }
.page-inv-settings .row-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; white-space: nowrap; }
.page-inv-settings select.std, .page-inv-settings input.std { font-size: 12px; padding: 2px; height: 26px; border: 1px solid #ccc; border-radius: 3px; background: #fff; }
.page-inv-settings input.std { width: 50px; text-align: center; }
.page-inv-settings select.std { width: auto; max-width: 100px; }
.page-inv-settings .date-display-btn { width: 100%; border: 1px solid #ccc; background: #f9f9f9; padding: 6px; border-radius: 4px; text-align: center; font-weight: bold; cursor: pointer; color: #333; margin-top: 5px; }
.page-inv-settings .date-display-btn.override { background: #ffebee; border-color: #ef9a9a; color: #c62828; }
.page-inv-settings .date-display-btn.today { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.page-inv-settings .vendor-opts { background: #f0f0f0; padding: 4px; border-radius: 4px; margin-top: 4px; }
.page-inv-settings .del-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 2px; }
.page-inv-settings .del-day-chk input { display: none; }
.page-inv-settings .quick-btn { width: 100%; padding: 12px 5px; border: 1px solid #ccc; border-radius: 6px; background: #eee; font-weight: bold; color: #555; cursor: pointer; font-size: 13px; white-space: nowrap; }
.page-inv-settings .quick-btn.active { background: #28a745; color: white; border-color: #28a745; }
.page-inv-settings .btn-primary { background: #007bff; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: bold; }
.page-inv-settings .btn-sec { background: #fff; border: 1px solid #ccc; color: #333; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.page-inv-settings .btn-del-x { color: #fff; background: #dc3545; border: none; width: 22px; height: 22px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.page-inv-settings .fixed-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 200; pointer-events: none; }
.page-inv-settings .footer-inner { max-width: 768px; margin: 0 auto; background: #fff; border-top: 1px solid #ccc; padding: 10px 15px; display: flex; justify-content: flex-end; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); pointer-events: auto; height: 60px; box-sizing: border-box; }
.page-inv-settings .spacer-bottom { height: 70px; }
.page-inv-settings .modal-header, .page-inv-settings .inv-settings-modal-header { padding: 12px; background: #f8f9fa; border-bottom: 1px solid #ddd; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.page-inv-settings .modal-body, .page-inv-settings .inv-settings-modal-body { padding: 15px; overflow-y: auto; flex: 1; }
.page-inv-settings .modal-footer, .page-inv-settings .inv-settings-modal-footer { padding: 10px; background: #fff; border-top: 1px solid #eee; text-align: right; }
.page-inv-settings .form-group { margin-bottom: 15px; }
.page-inv-settings .form-label { display: block; font-size: 11px; font-weight: bold; color: #555; margin-bottom: 5px; text-transform: uppercase; }
.page-inv-settings .form-control { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 14px; }
.page-inv-settings .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.page-inv-settings .btn-danger { background: #dc3545; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: bold; }
.page-inv-settings .drag-handle { cursor: grab; padding: 8px 5px; color: #999; font-size: 16px; user-select: none; }
.page-inv-settings .group-row { display: flex; gap: 5px; margin-bottom: 5px; align-items: center; background: #fff; padding: 5px; border: 1px solid transparent; }
.page-inv-settings .group-row.dragging { opacity: 0.5; border: 1px dashed #ccc; }
.page-inv-settings .ctrl-input { padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; }
.page-inv-settings .search-box { flex: 1; min-width: 120px; }
.page-inv-settings .group-header.closed { opacity: 0.7; }
.page-inv-settings .item-row.dragging { opacity: 0.5; background: #e3f2fd; }
.page-inv-settings .item-main { flex: 1; font-size: 13px; font-weight: 600; color: #333; }
.page-inv-settings .item-sub { font-size: 11px; color: #777; margin-left: 5px; font-weight: normal; }
.page-inv-settings .var-badge { font-size: 10px; background: #e3f2fd; color: #0d47a1; padding: 1px 5px; border-radius: 8px; margin-left: 5px; font-weight: bold; }
.page-inv-settings .ing-badge { font-size: 10px; background: #e8f5e9; color: #2e7d32; padding: 1px 5px; border-radius: 8px; margin-left: 3px; font-weight: bold; }
.page-inv-settings .inv-settings-modal-box.wide { max-width: 650px; }
.page-inv-settings .v-card { border: 1px solid #ddd; border-left: 3px solid #007bff; border-radius: 4px; padding: 8px; margin-bottom: 8px; background: #fff; position: relative; }
.page-inv-settings .v-card.dragging { opacity: 0.5; border: 2px dashed #007bff; }
.page-inv-settings .v-drag-handle { cursor: grab; font-size: 16px; color: #ccc; font-weight: bold; margin-right: 8px; line-height: 1; user-select: none; }
.page-inv-settings input.var-txt { width: 90px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; }
.page-inv-settings input.var-num { width: 70px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }
.page-inv-settings input.var-flex { flex: 1; min-width: 60px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; }
.page-inv-settings textarea.v-notes { width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; box-sizing: border-box; resize: vertical; min-height: 32px; font-family: inherit; }
.page-inv-settings .store-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.page-inv-settings .store-opt { font-size: 13px; padding: 6px 12px; border: 1px solid #ccc; border-radius: 14px; background: #fff; cursor: pointer; display: flex; align-items: center; gap: 4px; user-select: none; }
.page-inv-settings .store-opt.active { background: #007bff; color: white; border-color: #007bff; }
.page-inv-settings .star { font-size: 14px; color: #ccc; margin-left: 2px; }
.page-inv-settings .star.is-def { color: #ffd700; }
.page-inv-settings .v-lbl-dyn { font-size: 11px; margin-right: 5px; font-weight: bold; color: #555; min-width: 60px; text-align: right; }
.page-inv-settings .cat-row { display: flex; gap: 5px; margin-bottom: 5px; align-items: center; background: #f9f9f9; padding: 5px; border: 1px solid #eee; }
.page-inv-settings .recipe-panel { display: none; margin-top: 10px; background: #fefefe; border: 1px dashed #ccc; padding: 8px; border-radius: 4px; }
.page-inv-settings .recipe-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; align-items: center; background: #fff; border: 1px solid #eee; padding: 5px; border-radius: 4px; }
.page-inv-settings .recipe-row.dragging { opacity: 0.5; background: #e3f2fd; }
.page-inv-settings .recipe-row.custom-row { background: #fff8e1; }
.page-inv-settings .rec-item { display: flex; align-items: center; }
.page-inv-settings .ri-drag { width: 20px; justify-content: center; }
.page-inv-settings .ri-sec { width: 80px; }
.page-inv-settings .ri-name { flex: 1; min-width: 120px; }
.page-inv-settings .ri-qty { width: 70px; }
.page-inv-settings .ri-unit { width: 60px; }
.page-inv-settings .ri-chk { width: 35px; justify-content: center; display: flex; flex-direction: column; font-size: 9px; text-align: center; line-height: 1; }
.page-inv-settings .ri-del { width: 25px; justify-content: center; }
.page-inv-settings .rec-input { padding: 5px; border: 1px solid #ccc; font-size: 12px; border-radius: 3px; width: 100%; box-sizing: border-box; }
.page-inv-settings .rec-select { padding: 4px; border: 1px solid #ccc; font-size: 11px; border-radius: 3px; width: 100%; box-sizing: border-box; }
.page-inv-settings .btn-tiny { padding: 3px 6px; font-size: 10px; border-radius: 3px; cursor: pointer; }
.page-inv-settings .search-wrap { position: relative; width: 100%; }
.page-inv-settings .search-res { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid #ccc; z-index: 1000; max-height: 200px; overflow-y: auto; display: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.page-inv-settings .search-opt { padding: 6px 8px; cursor: pointer; border-bottom: 1px solid #eee; font-size: 12px; }
.page-inv-settings .search-opt:hover { background: #e3f2fd; }
.page-inv-settings .rec-header { display: flex; gap: 5px; font-size: 10px; color: #666; margin-bottom: 2px; padding: 0 5px; }
.page-inv-settings .legend { font-size: 11px; color: #666; background: #f9f9f9; padding: 5px; border-top: 1px solid #eee; margin-top: 10px; font-style: italic; }
@media (max-width: 480px) {
    .page-inv-settings .ri-sec { width: 70px; }
    .page-inv-settings .ri-qty { width: 60px; }
    .page-inv-settings .ri-unit { width: 50px; }
}

/* ========== ADMIN MODULE ========== */
.page-admin .setup-box { background: white; border-radius: 8px; padding: 20px; margin: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); text-align: center; border: 1px solid #eee; }
.page-admin .btn-gen { background: #673AB7; color: white; border: none; width: 100%; padding: 12px; font-size: 1rem; border-radius: 6px; cursor: pointer; margin-top: 15px; font-weight: bold; }
.page-admin .btn-gen:hover { background: #5E35B1; }
.page-admin .btn-trust { background: #007bff; color: white; border: none; width: 100%; padding: 12px; font-size: 1rem; border-radius: 6px; cursor: pointer; margin-top: 15px; font-weight: bold; }
.page-admin .msg { padding: 15px; border-radius: 6px; margin: 20px 20px 0 20px; font-weight: bold; text-align: center; }
.page-admin .msg-success { background: #e8f5e9; color: #2e7d32; }
.page-admin .msg-error { background: #ffebee; color: #c62828; }
.page-admin .current-status { margin: 15px 0; padding: 10px; border-radius: 6px; font-size: 0.95rem; font-weight: bold; border: 1px solid transparent; }
.page-admin .status-on { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.page-admin .status-off { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.page-admin .group-header { background: #333; color: white; padding: 10px 15px; margin-top: 25px; border-radius: 4px 4px 0 0; font-weight: bold; font-size: 1rem; display: flex; justify-content: space-between; margin-left: 10px; margin-right: 10px; }
.page-admin .admin-box { margin: 0 10px; background: white; border-radius: 0 0 4px 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); border: 1px solid #ddd; border-top: none; overflow-x: auto; }
.page-admin .user-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 600px; }
.page-admin .user-table th, .page-admin .user-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-admin .user-table th { background: #f4f4f4; color: #555; font-size: 0.85rem; border-right: 1px solid #eee; }
.page-admin .role-badge { padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; }
.page-admin .role-owner { background: #E1BEE7; color: #7B1FA2; }
.page-admin .role-manager { background: #BBDEFB; color: #1976D2; }
.page-admin .role-employee { background: #E0E0E0; color: #616161; }
.page-admin .admin-modal-overlay, .page-admin .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 2900; }
.page-admin .admin-modal, .page-admin .modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 25px; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 3000; width: 400px; }
.page-admin .main-container { background: #fff; min-height: calc(100vh - 50px); border-left: 1px solid #ddd; border-right: 1px solid #ddd; display: flex; flex-direction: column; position: relative; padding: 0; }
.page-admin .status-icon { font-size: 2rem; margin-bottom: 10px; }
.page-admin select { padding: 10px; font-size: 1rem; width: 100%; margin-top: 10px; border-radius: 6px; border: 1px solid #ccc; box-sizing: border-box; }
.page-admin .dist-info { color: #666; font-size: 0.9rem; margin-top: 5px; }
.page-admin .btn-small { padding: 5px 10px; border: 1px solid #ccc; background: #fff; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
.page-admin .btn-tool { padding: 6px 15px; border: 1px solid #2e7d32; background: #2e7d32; color: white; font-size: 0.85rem; border-radius: 4px; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-block; }
.page-admin .w-name { width: 25%; } .page-admin .w-code { width: 15%; } .page-admin .w-role { width: 15%; } .page-admin .w-access { width: 20%; } .page-admin .w-rate { width: 10%; } .page-admin .w-act { width: 15%; }
.page-admin .form-group { margin-bottom: 15px; }
.page-admin .form-control { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.page-admin .store-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #f9f9f9; padding: 10px; border-radius: 4px; border: 1px solid #eee; }
.page-admin .input-group { display: flex; gap: 5px; }
.page-admin .store-opt { display: block; cursor: pointer; }
.page-admin .btn-gen.orange { background: #ff9800; border: none; color: white; border-radius: 4px; cursor: pointer; padding: 0 10px; font-weight: bold; font-size: 1rem; }

/* ========== DASHBOARD ========== */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.dash-box { padding: 20px; border-radius: 8px; color: white; text-decoration: none; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.2s; display: block; position: relative; text-align: center; }
a.dash-box:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.dash-box h3 { margin: 0 0 10px 0; font-size: 1.3rem; }
.dash-box p { margin: 0; font-size: 0.95rem; opacity: 0.95; line-height: 1.4; }
.box-links { margin: 0; font-size: 0.95rem; }
.box-links a { color: white; text-decoration: underline; margin-right: 0; font-weight: bold; cursor: pointer; display: inline-block; }
.box-links a:hover { color: #ffeb3b; text-decoration: none; }
.box-green { background: #4CAF50; }
.box-orange { background: #FF9800; }
.box-blue { background: #2196F3; }
.box-purple { background: #9C27B0; }
.box-lightblue { background: #03A9F4; }
.box-lightpurple { background: #673AB7; }
.box-teal { background: #009688; }
.box-cyan { background: #00BCD4; }
@media (max-width: 550px) { #square-widget { grid-column: span 1 !important; } }

/* ========== SET NAV TABS ========== */
.tabs { display: flex; gap: 5px; padding: 0 10px; border-bottom: 2px solid #ddd; background: #f8f9fa; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-btn { padding: 10px 15px; border: none; background: none; font-size: 13px; cursor: pointer; border-bottom: 3px solid transparent; color: #666; white-space: nowrap; font-weight: bold; text-decoration: none; display: inline-block; }
.tab-btn:hover { background-color: #eee; }
.tab-btn.active { border-bottom-color: #007bff; color: #007bff; background-color: #fff; }

/* ========== SQUARE DASHBOARD WIDGET ========== */
#combined-sales-widget { grid-column: span 2; cursor: pointer; transition: transform 0.2s; }
#combined-sales-widget:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
@media (max-width: 600px) { #combined-sales-widget { grid-column: span 1 !important; } }
.sq-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; table-layout: fixed; }
.sq-table th:first-child, .sq-table td:first-child { width: 45px; text-align: left; }
.sq-store-col { text-align: right; padding: 2px 1px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.sq-val-col { text-align: right; padding: 2px 1px; }
.sq-faded { opacity: 0.3; }
.sq-debug { font-size: 0.7rem; color: #ffcccc; margin-top: 5px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 5px; }
.sq-link { color: white; text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.7); position: relative; z-index: 10; }
.sq-link:hover { text-decoration: none; border-bottom: 1px solid white; }