:root{--ink:#1d2433;--muted:#697386;--brand:#6c3c35;--brand2:#a86e5e;--cream:#f8f4ef;--paper:#fff;--line:#e3e6ec;--green:#247553;--red:#a94343;--shadow:0 12px 35px rgba(31,41,55,.09);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;color:var(--ink);background:var(--cream);font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;font-size:15px;line-height:1.5;letter-spacing:-.006em}
button,input,select,textarea{font:inherit}
button{cursor:pointer;letter-spacing:-.005em}
.hidden{display:none!important}
.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 15% 15%,#ead7ce,transparent 36%),radial-gradient(circle at 85% 80%,#d7c1b5,transparent 32%),var(--cream)}
.login-card{width:min(420px,100%);background:#fff;padding:38px;border-radius:28px;box-shadow:var(--shadow);border:1px solid rgba(108,60,53,.1)}
.brand-mark{width:58px;height:58px;border-radius:18px;background:var(--brand);color:white;display:grid;place-items:center;font-size:30px;font-weight:800;letter-spacing:-.05em;margin-bottom:20px}
.eyebrow{text-transform:uppercase;letter-spacing:.075em;font-size:11px;line-height:1.4;color:var(--brand2);font-weight:750;margin:0 0 7px}
.login-card h1{font-size:32px;line-height:1.2;letter-spacing:-.035em;font-weight:750;margin:0 0 8px}
.muted{color:var(--muted)}
label{display:grid;gap:7px;font-size:13px;line-height:1.4;font-weight:650;margin:18px 0}
input,select,textarea{width:100%;padding:12px 13px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);outline:none;font-weight:450}
input:focus,select:focus,textarea:focus{border-color:var(--brand2);box-shadow:0 0 0 3px rgba(168,110,94,.12)}
textarea{min-height:84px;resize:vertical}
.primary{border:0;background:var(--brand);color:#fff;padding:12px 18px;border-radius:12px;font-weight:700}
.login-card .primary{width:100%;margin-top:8px}
.error{color:var(--red);font-size:13px}
.app{min-height:100vh;display:grid;grid-template-columns:248px 1fr}
.sidebar{background:#251c19;color:#f8eee9;padding:28px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.logo{display:flex;align-items:center;gap:12px;padding:0 10px 28px}
.logo>span{width:38px;height:38px;background:#fff;color:var(--brand);border-radius:12px;display:grid;place-items:center;font-size:21px;font-weight:800;letter-spacing:-.04em}
.logo strong,.logo small{display:block}
.logo strong{font-size:15px;line-height:1.25;font-weight:750;letter-spacing:-.015em}.logo small{color:#baa9a2;font-size:11px;line-height:1.3;margin-top:2px;letter-spacing:.015em}
.sidebar nav{display:grid;gap:7px}
.sidebar nav button{border:0;background:transparent;color:#cdbdb7;text-align:left;padding:13px 14px;border-radius:12px;font-size:14px;line-height:1.4;font-weight:600;display:flex;align-items:center;gap:12px}
.sidebar nav button.active,.sidebar nav button:hover{background:#3b2b27;color:white}
.user-box{margin-top:auto;border-top:1px solid #493732;padding:18px 10px 0;display:grid;gap:5px;font-size:13px}
.link{border:0;background:none;color:#d6a99b;text-align:left;padding:0}
main{padding:34px;min-width:0}
header{display:flex;justify-content:space-between;align-items:center;margin-bottom:28px}
header h2{font-size:30px;line-height:1.2;letter-spacing:-.035em;font-weight:750;margin:0}
.icon-button{border:0;background:#f3ebe7;border-radius:10px;width:38px;height:38px;font-size:20px}
#mobile-menu{display:none}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.stats article,.money-stats article{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:0 3px 12px rgba(40,20,10,.03)}
.stats span,.money-stats span{font-size:12px;line-height:1.4;color:var(--muted);font-weight:650;letter-spacing:.005em}
.stats strong,.money-stats strong{display:block;font-size:27px;line-height:1.15;letter-spacing:-.035em;font-weight:750;margin:8px 0 5px}
.stats small{color:var(--muted);font-size:12px;line-height:1.4}
.panel{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 3px 15px rgba(40,20,10,.035)}
.welcome{margin-top:18px;padding:26px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.welcome h3,.compact h3{font-size:25px;line-height:1.25;letter-spacing:-.03em;font-weight:750;margin:3px 0 8px}
.welcome p{color:var(--muted);max-width:650px}
.toolbar{display:flex;justify-content:space-between;gap:14px;margin-bottom:16px}
.search{display:flex;width:min(520px,100%)}
.search input{border-radius:12px 0 0 12px}
.search button,.date-filter button{border:1px solid var(--line);background:white;border-radius:0 12px 12px 0;padding:0 18px}
.split{display:grid;grid-template-columns:360px 1fr;gap:16px}
.list-panel{overflow:hidden}
.customer-list{max-height:calc(100vh - 190px);overflow:auto}
.customer-row{width:100%;border:0;border-bottom:1px solid var(--line);background:white;padding:16px;text-align:left;display:flex;justify-content:space-between;gap:10px}
.customer-row:hover,.customer-row.active{background:#faf4f0}
.customer-row strong,.customer-row small{display:block}
.customer-row small{color:var(--muted);margin-top:3px}
.badge{display:inline-flex;align-items:center;padding:5px 9px;background:#f2e7e2;color:var(--brand);border-radius:999px;font-size:11px;font-weight:800}
.detail-panel{padding:24px;min-height:420px}
.detail-panel.empty{display:grid;place-items:center;color:var(--muted)}
.detail-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:18px}
.detail-head h3{font-size:26px;line-height:1.25;letter-spacing:-.03em;font-weight:750;margin:0 0 4px}
.cards-head{display:flex;justify-content:space-between;align-items:center;margin-top:22px}
.cards{display:grid;gap:12px}
.service-card{border:1px solid var(--line);border-radius:16px;padding:16px}
.card-top{display:flex;justify-content:space-between;gap:12px}
.remaining{font-size:25px;line-height:1.2;letter-spacing:-.025em;font-weight:800;color:var(--green)}
.remaining.low{color:#b06a2f}
.progress{height:7px;background:#eee8e4;border-radius:99px;overflow:hidden;margin:12px 0}
.progress i{display:block;height:100%;background:var(--green)}
.card-meta{display:flex;flex-wrap:wrap;gap:7px;color:var(--muted);font-size:12px}
.card-actions{display:flex;justify-content:flex-end;margin-top:12px}
.small-button{border:1px solid var(--line);background:white;padding:8px 11px;border-radius:10px;font-size:13px;font-weight:650}
.money-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:16px}
.money-stats article:last-child{background:#2f5041;color:white}
.money-stats article:last-child span{color:#c8d9d0}
.date-filter{display:flex;align-items:center;gap:8px}
.date-filter input{width:auto}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:700px}
th,td{padding:14px 16px;border-bottom:1px solid var(--line);text-align:left;font-size:13px;line-height:1.45}
th{color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.055em;text-transform:uppercase}
.right{text-align:right}
.income{color:var(--green);font-weight:800}
.expense{color:var(--red);font-weight:800}
.compact{padding:25px;width:min(520px,100%)}
dialog{border:0;padding:0;border-radius:20px;box-shadow:0 25px 80px rgba(0,0,0,.25);width:min(560px,calc(100% - 28px))}
dialog::backdrop{background:rgba(25,18,16,.55);backdrop-filter:blur(3px)}
dialog form{padding:24px}
.modal-head,.modal-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
.modal-head h3{font-size:24px;line-height:1.25;letter-spacing:-.025em;font-weight:750;margin:0}
.modal-actions{justify-content:flex-end;margin-top:20px}
.modal-actions>button:first-child{border:1px solid var(--line);background:white;padding:11px 17px;border-radius:12px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.form-grid .wide{grid-column:1/-1}
.toast{position:fixed;right:25px;top:25px;background:#243d32;color:white;padding:13px 17px;border-radius:12px;z-index:20;box-shadow:var(--shadow)}
.button-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.appointment-board{display:grid;gap:10px}
.appointment-card{display:grid;grid-template-columns:100px minmax(0,1fr) 145px;gap:16px;align-items:center;background:#fff;border:1px solid var(--line);border-left:5px solid var(--brand2);border-radius:16px;padding:16px;box-shadow:0 3px 12px rgba(40,20,10,.03)}
.appointment-card.status-completed{border-left-color:var(--green)}
.appointment-card.status-cancelled,.appointment-card.status-no_show{opacity:.65;border-left-color:var(--red)}
.appointment-card.status-in_service{border-left-color:#c28a32}
.appointment-time{font-size:17px;line-height:1.3;font-weight:750;color:var(--brand)}
.appointment-info{display:grid;gap:3px;min-width:0}
.appointment-info span,.appointment-info small{color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.status-select{padding:9px}
.empty-state{padding:45px;text-align:center;color:var(--muted)}
.catalog-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.catalog-panel{padding:22px}
.section-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:15px;margin-bottom:5px}
.section-head h3{font-size:24px;line-height:1.25;letter-spacing:-.025em;font-weight:750;margin:0}
.catalog-row{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:14px 4px;border-bottom:1px solid var(--line)}
.catalog-row strong,.catalog-row small{display:block}
.catalog-row small{color:var(--muted);margin-top:3px}
.catalog-row b{white-space:nowrap;color:var(--brand)}
.block-muted{display:block;color:var(--muted);margin-top:3px}
.stock-actions{display:flex;align-items:center;gap:9px}.stock-low{background:#fff5f2}.stock-low b{color:var(--red)}
.source-report{margin-top:16px}.reminder-overdue{background:#fff5f2}.reminder-overdue b{color:var(--red)}.reminder-today{background:#fff9e9}.reminder-upcoming b{color:var(--green)}
.retention-head{margin:28px 0 12px}.retention-head h3{font-size:25px;line-height:1.25;letter-spacing:-.03em;font-weight:750;margin:2px 0}.retention-stats{grid-template-columns:repeat(5,1fr);margin-bottom:16px}.retention-stats article:first-child{background:#2f5041;color:#fff}.retention-stats article:first-child span,.retention-stats article:first-child small{color:#c8d9d0}
.invoice-head{margin:22px 0 10px}.invoice-head h3{font-size:19px}.invoice-item{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px;margin-bottom:10px;border:1px solid #e6ddd8;border-radius:14px;background:#faf7f5}.invoice-item .wide{grid-column:1/-1}.invoice-item .invoice-remove{justify-self:start;color:#9a3f37}#invoice-preview{display:block;text-align:right;margin-top:14px;font-size:18px;color:var(--brand)}
.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0 18px}.permission-grid label{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #e6ddd8;border-radius:10px}.permission-grid input{width:auto;margin:0}#account-admin{margin-top:18px}
.mobile-tabs{display:none}
.mobile-dashboard-head,.mobile-period-tabs,.mobile-report-menu{display:none}

@media(max-width:950px){.stats{grid-template-columns:1fr 1fr}
.retention-stats{grid-template-columns:repeat(2,1fr)}
.split{grid-template-columns:300px 1fr}
.app{grid-template-columns:210px 1fr}
main{padding:25px}
.sidebar{padding-inline:12px}
}

@media(max-width:720px){:root{--brand:#168ff0;--brand2:#168ff0;--cream:#f3f5f9;--line:#e5e8ee;--ink:#172033;--muted:#768092}
body{background:var(--cream);font-size:15px;line-height:1.5}
.app{display:block}
.sidebar{position:fixed;z-index:30;left:-290px;width:280px;transition:.2s;background:#fff;color:var(--ink);box-shadow:16px 0 45px rgba(20,34,60,.18);padding-top:max(24px,env(safe-area-inset-top))}
.sidebar.open{left:0}
.logo{padding:10px 10px 22px;border-bottom:1px solid var(--line)}
.logo>span{background:var(--brand);color:#fff}.logo small{color:var(--muted)}
.sidebar nav{gap:2px;margin-top:12px}.sidebar nav button{color:#28344a;padding:15px 14px;font-size:15px;font-weight:600}.sidebar nav button.active,.sidebar nav button:hover{background:#eaf5ff;color:#087dcc}
.user-box{border-color:var(--line);color:var(--ink)}.link{color:#087dcc}
main{padding:0 14px calc(92px + env(safe-area-inset-bottom));min-height:100vh}
header{margin:0 -14px 14px;padding:max(14px,env(safe-area-inset-top)) 18px 14px;background:#fff;color:var(--ink);min-height:72px;align-items:flex-end;border-bottom:1px solid var(--line);box-shadow:none}
header .eyebrow{color:#dff3ff;letter-spacing:.015em;text-transform:none;font-size:12px;font-weight:600}header h2{font-size:26px;line-height:1.2;letter-spacing:-.035em;font-weight:750}
main[data-view="dashboard"]>header{display:none}
#mobile-menu{display:block;background:#eef6ff;color:var(--brand)}
.mobile-dashboard-head{display:flex;margin:-14px -14px 0;padding:18px 18px 14px;background:linear-gradient(145deg,#24a6f4,#087cf0);color:#fff;align-items:center;justify-content:space-between}.mobile-dashboard-head div{display:grid}.mobile-dashboard-head strong{font-size:20px}.mobile-dashboard-head small{color:#dff3ff}.mobile-dashboard-head button{border:0;background:rgba(255,255,255,.18);color:#fff;width:42px;height:42px;border-radius:50%;font-size:21px}.mobile-period-tabs{display:grid;grid-template-columns:repeat(3,1fr);margin:0 -14px 14px;background:#fff;border-bottom:1px solid var(--line)}.mobile-period-tabs button{height:52px;border:0;background:#fff;font-weight:700;font-size:16px}.mobile-period-tabs button.active{color:var(--brand);border-bottom:3px solid var(--brand)}
#view-dashboard~*{}#view-dashboard .stats article:nth-child(-n+2){background:#fff}#view-dashboard .stats article{position:relative;padding-top:44px}#view-dashboard .stats article:before{position:absolute;left:16px;top:14px;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:#edf7ff;color:var(--brand);font-size:14px}#view-dashboard .stats article:nth-child(1):before{content:'₫'}#view-dashboard .stats article:nth-child(2):before{content:'↗'}#view-dashboard .stats article:nth-child(3):before{content:'♙'}#view-dashboard .stats article:nth-child(4):before{content:'▣'}
.stats{grid-template-columns:1fr 1fr}.money-stats,.split{grid-template-columns:1fr}
.retention-stats{grid-template-columns:1fr 1fr}
.stats{gap:10px}
.stats article,.money-stats article{border:0;border-radius:16px;padding:16px;box-shadow:0 3px 13px rgba(32,54,88,.07);min-height:126px}.stats strong,.money-stats strong{font-size:25px;font-weight:750}.stats span,.money-stats span{font-size:13px;line-height:1.35;font-weight:650}.stats small{font-size:12px;line-height:1.4}
.split{gap:12px}
.customer-list{max-height:330px}
.toolbar{align-items:stretch;flex-direction:column;background:#fff;margin:0 -14px 14px;padding:14px;border-bottom:1px solid var(--line)}
.toolbar>.primary{width:100%}
.primary{background:var(--brand);min-height:46px;font-size:15px;font-weight:700}.welcome{align-items:flex-start;flex-direction:column;padding:20px;border:0;border-radius:16px}.welcome h3,.compact h3{font-size:22px;line-height:1.3;letter-spacing:-.025em;font-weight:750}
.search{width:100%}.search input{min-width:0}.date-filter{display:grid;grid-template-columns:1fr auto 1fr}
.date-filter button{grid-column:1/-1;border-radius:12px;padding:10px}
.form-grid{grid-template-columns:1fr}
.form-grid .wide{grid-column:auto}
.detail-head{gap:15px}
.catalog-grid{grid-template-columns:1fr}
.appointment-card{grid-template-columns:76px 1fr}
.appointment-card .status-select{grid-column:1/-1}
.button-row{flex-direction:column}
.panel{border:0;border-radius:16px;box-shadow:0 3px 13px rgba(32,54,88,.06)}
.catalog-panel{padding:16px}.section-head h3,.detail-head h3{font-size:21px;line-height:1.3;letter-spacing:-.025em;font-weight:750}.catalog-row{min-height:62px}.small-button{min-height:40px;font-size:13px;font-weight:650}
.appointment-card{border:0;border-left:4px solid var(--brand);box-shadow:0 3px 13px rgba(32,54,88,.06)}
#view-pos .toolbar>.primary,#view-appointments .toolbar>.primary{position:fixed;z-index:24;left:20px;bottom:calc(82px + env(safe-area-inset-bottom));width:58px;height:58px;min-height:58px;border-radius:16px;padding:0;font-size:0;box-shadow:0 7px 22px rgba(22,143,240,.35)}#view-pos .toolbar>.primary:after,#view-appointments .toolbar>.primary:after{content:'+';font-size:39px;font-weight:300;line-height:1}
#view-pos .money-stats{grid-template-columns:1fr 1fr}#view-pos .money-stats article{min-height:98px;padding:14px}#view-pos .money-stats article:last-child{grid-column:1/-1}
#view-pos table{min-width:620px}#view-pos .table-wrap{border-radius:14px}
.mobile-report-menu{display:grid;margin-bottom:14px;overflow:hidden}.mobile-report-menu button{display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;text-align:left;border:0;border-bottom:1px solid var(--line);background:#fff;min-height:62px;padding:10px 16px;font-size:16px}.mobile-report-menu button:last-child{border-bottom:0}.mobile-report-menu button span{font-size:20px;color:#718096}.mobile-report-menu button b{font-size:28px;color:#8b98a8;font-weight:400}
.sidebar{left:0;top:0;bottom:0;width:100%;height:100dvh;transform:translateX(-105%);transition:transform .22s;padding:0 0 calc(18px + env(safe-area-inset-bottom));box-shadow:none;overflow:auto}.sidebar.open{left:0;transform:translateX(0)}.sidebar .logo{min-height:190px;padding:calc(28px + env(safe-area-inset-top)) 22px 24px;background:linear-gradient(145deg,#24a6f4,#087cf0);color:#fff;border:0;align-items:flex-end}.sidebar .logo>span{width:74px;height:74px;border-radius:50%;font-size:34px;background:#fff;color:var(--brand)}.sidebar .logo strong{font-size:22px}.sidebar .logo small{color:#dff3ff;font-size:13px}.sidebar nav{margin:10px 14px}.sidebar nav button{border-bottom:1px solid var(--line);border-radius:0;min-height:56px}.sidebar nav button:after{content:'›';margin-left:auto;color:#8390a0;font-size:24px}.sidebar nav button.active,.sidebar nav button:hover{background:#f7fbff}.user-box{margin:8px 24px 0;padding:16px 0}
.mobile-tabs{position:fixed;z-index:25;display:grid;grid-template-columns:repeat(5,1fr);left:0;right:0;bottom:0;padding:7px 4px calc(7px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);border-top:1px solid #e3e7ed;box-shadow:0 -5px 20px rgba(25,42,70,.06)}
.mobile-tabs button{border:0;background:transparent;color:#737c89;display:grid;justify-items:center;gap:3px;padding:3px 1px;font-size:10px;line-height:1.3;font-weight:600;letter-spacing:0;min-width:0}.mobile-tabs button.active{color:var(--brand);font-weight:700}.mobile-tabs .tab-icon{font-size:22px;line-height:24px;font-weight:500}.mobile-tabs button:last-child .tab-icon{font-size:15px;letter-spacing:2px;padding-top:4px}
.toast{top:auto;bottom:calc(82px + env(safe-area-inset-bottom));left:14px;right:14px;text-align:center}
dialog{border-radius:18px 18px 0 0;width:100%;max-width:none;margin:auto 0 0;max-height:92vh}dialog form{padding:20px 18px calc(20px + env(safe-area-inset-bottom));overflow:auto;max-height:92vh}.modal-head h3{font-size:22px;line-height:1.3;letter-spacing:-.025em;font-weight:750}
input,select,textarea{min-height:46px;font-size:16px}
}
