/* ========== Maki Manager Styles ========== */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Sarabun','Inter',sans-serif; background:#faf5f5; color:#1e293b; min-height:100vh; padding-bottom:24px; }

/* Header — Maki red */
.app-header { background:linear-gradient(135deg,#7f1d1d 0%,#b91c1c 60%,#dc2626 100%); color:#fff; padding:14px 20px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:50; }
.app-header h1 { font-size:18px; font-weight:700; }
.header-user { display:flex; align-items:center; gap:8px; font-size:14px; }
.header-badge { font-size:18px; }

/* Container */
.container { max-width:500px; margin:0 auto; padding:16px; }

/* App title */
.app-title { text-align:center; padding:32px 0 24px; }
.app-icon { font-size:48px; margin-bottom:8px; }
.app-title h1 { font-size:24px; font-weight:800; color:#7f1d1d; }
.app-subtitle { color:#64748b; font-size:14px; }

/* Labels */
.section-label { font-size:13px; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:0.5px; margin:16px 0 8px; }

/* Menu cards */
.menu-card { display:flex; align-items:center; gap:14px; background:#fff; border-radius:14px; padding:16px; margin-bottom:10px; cursor:pointer; transition:transform .15s,box-shadow .15s; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.menu-card:active { transform:scale(.97); }
.mc-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:22px; background:#fef2f2; flex-shrink:0; }
.mc-body { flex:1; min-width:0; }
.mc-name { font-weight:700; font-size:16px; }
.mc-role { font-size:12px; color:#64748b; }
.mc-desc { font-size:13px; color:#64748b; margin-top:2px; }
.menu-feature { border-left-width:4px; border-left-style:solid; }

/* Branch title */
.branch-title { display:flex; align-items:center; gap:12px; margin-bottom:20px; padding:8px 0; }
.bt-icon { font-size:32px; }
.branch-title h2 { font-size:22px; font-weight:800; color:#7f1d1d; }

/* Back button */
.back-btn { background:none; border:none; color:#b91c1c; font-size:14px; font-weight:600; cursor:pointer; padding:4px 0; font-family:inherit; }

/* Module header */
.mod-header { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.mod-header h2 { font-size:17px; font-weight:700; }

/* Month nav */
.month-nav { display:flex; align-items:center; justify-content:center; gap:16px; margin-bottom:16px; }
.nav-btn { background:none; border:2px solid #e2e8f0; border-radius:10px; width:40px; height:40px; font-size:16px; cursor:pointer; color:#475569; font-family:inherit; }
.nav-btn:active { background:#e2e8f0; }
.month-label { font-size:22px; font-weight:800; color:#7f1d1d; min-width:120px; text-align:center; }

/* Tab bar */
.tab-bar { display:flex; gap:6px; margin-bottom:16px; overflow-x:auto; }
.tab-scroll { flex-wrap:nowrap; }
.tab-btn { flex-shrink:0; padding:8px 14px; border-radius:10px; border:2px solid #e2e8f0; background:#fff; font-weight:600; font-size:13px; cursor:pointer; color:#64748b; font-family:inherit; white-space:nowrap; transition:all .15s; }
.tab-btn.active { background:#7f1d1d; color:#fff; border-color:#7f1d1d; }

/* Buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; padding:10px 20px; border:none; border-radius:10px; font-size:15px; font-weight:600; cursor:pointer; font-family:inherit; transition:transform .1s; }
.btn:active { transform:scale(.97); }
.btn-primary { background:#7f1d1d; color:#fff; }
.btn-secondary { background:#e2e8f0; color:#475569; }
.btn-sm { padding:6px 12px; font-size:13px; border-radius:8px; }
.btn-block { width:100%; }
.btn-lg { padding:14px 24px; font-size:17px; }
.btn:disabled { opacity:.5; pointer-events:none; }

/* Forms */
.form-group { margin-bottom:12px; }
.form-label { display:block; font-size:13px; font-weight:600; color:#475569; margin-bottom:4px; }
.form-input { width:100%; padding:10px 12px; border:1.5px solid #e2e8f0; border-radius:10px; font-size:15px; font-family:inherit; }
.form-input:focus { border-color:#b91c1c; outline:none; }
.form-textarea { resize:vertical; min-height:48px; }

/* Modal */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:100; display:flex; align-items:flex-end; justify-content:center; }
.modal-box { background:#fff; border-radius:20px 20px 0 0; padding:20px; width:100%; max-width:500px; max-height:85vh; overflow-y:auto; animation:slideUp .25s; }
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.modal-head strong { font-size:17px; }
.modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:#94a3b8; }
.modal-actions { display:flex; gap:10px; margin-top:16px; }
.modal-actions .btn { flex:1; }

/* Toast */
#toast { position:fixed; bottom:80px; left:50%; transform:translateX(-50%); padding:10px 24px; border-radius:12px; font-size:14px; font-weight:600; z-index:200; opacity:0; transition:opacity .3s; pointer-events:none; background:#1e293b; color:#fff; }
#toast.show { opacity:1; }
#toast.success { background:#059669; }
#toast.error { background:#ef4444; }

/* Utilities */
.loading { text-align:center; padding:60px 20px; color:#64748b; }
.spinner { width:32px; height:32px; border:3px solid #e2e8f0; border-top-color:#b91c1c; border-radius:50%; animation:spin .7s linear infinite; margin:0 auto 12px; }
@keyframes spin { to { transform:rotate(360deg); } }
.empty-state { text-align:center; padding:40px; color:#94a3b8; font-size:14px; }
.hidden { display:none!important; }
.mb-8 { margin-bottom:8px; }
.mb-16 { margin-bottom:16px; }
.mt-8 { margin-top:8px; }
.mt-16 { margin-top:16px; }

/* ===== Financial ===== */
.fin-card { background:#fff; border-radius:12px; padding:14px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.fin-top { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.fin-icon { font-size:18px; }
.fin-label { flex:1; font-weight:600; font-size:14px; }
.fin-bench { font-size:11px; color:#94a3b8; margin-bottom:6px; }
.status-pill { padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700; }
.status-green { background:#f0fdf4; color:#059669; }
.status-yellow { background:#fefce8; color:#a16207; }
.status-red { background:#fef2f2; color:#dc2626; }

.fin-profit-card, .fin-bep-card { background:#fff; border-radius:12px; padding:16px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.profit-header { font-weight:700; font-size:15px; margin-bottom:10px; }
.profit-row { display:flex; justify-content:space-between; padding:6px 0; font-size:14px; }
.profit-val { font-weight:700; }
.profit-val.cost { color:#dc2626; }
.profit-total { border-top:2px solid #e2e8f0; margin-top:8px; padding-top:10px; font-size:15px; font-weight:700; border-radius:8px; padding:10px; }
.status-bg-green { background:#f0fdf4; color:#059669; }
.status-bg-yellow { background:#fefce8; color:#a16207; }
.status-bg-red { background:#fef2f2; color:#dc2626; }

.bep-formula { font-size:13px; color:#475569; margin-bottom:10px; line-height:1.8; }
.bep-result { font-size:16px; font-weight:700; margin-bottom:8px; }
.bep-num { font-size:22px; color:#b91c1c; }
.bep-status { padding:10px; border-radius:8px; font-size:14px; font-weight:600; }
.bep-above { background:#f0fdf4; color:#059669; }
.bep-below { background:#fef2f2; color:#dc2626; }

/* ===== Customer ===== */
.chip-wrap { display:flex; flex-wrap:wrap; gap:6px; }
.chip { padding:6px 14px; border-radius:20px; border:1.5px solid #e2e8f0; background:#fff; font-size:13px; font-weight:500; cursor:pointer; font-family:inherit; transition:all .15s; }
.chip-active { background:#b91c1c; color:#fff; border-color:#b91c1c; }

.tip-card { display:flex; gap:12px; background:#fff; border-radius:12px; padding:14px; margin-bottom:8px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.tip-icon { font-size:24px; flex-shrink:0; }
.tip-body { flex:1; }
.tip-title { font-weight:700; font-size:14px; margin-bottom:2px; }
.tip-desc { font-size:13px; color:#64748b; }

.idea-card { display:flex; align-items:center; gap:10px; background:#fff; border-radius:10px; padding:12px; margin-bottom:6px; cursor:pointer; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.idea-icon { font-size:16px; }
.idea-add { color:#b91c1c; font-weight:700; font-size:18px; margin-left:auto; }

.lsm-card { background:#fff; border-radius:12px; padding:14px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.lsm-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.lsm-title { font-weight:700; font-size:15px; }
.lsm-detail { font-size:13px; color:#475569; margin-bottom:4px; }
.lsm-date { font-size:12px; color:#94a3b8; }

/* ===== Operation ===== */
.sop-guide { background:#fff; border-radius:12px; padding:16px; margin-top:16px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.sop-guide-title { font-weight:700; font-size:14px; margin-bottom:10px; }
.sop-guide-item { font-size:13px; padding:4px 0; color:#475569; border-bottom:1px solid #f1f5f9; }

.sop-card { background:#fff; border-radius:12px; padding:14px; margin-bottom:8px; cursor:pointer; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.sop-card:active { transform:scale(.98); }
.sop-card-top { display:flex; align-items:center; gap:10px; }
.sop-card-icon { font-size:24px; }
.sop-card-name { font-weight:700; font-size:15px; }
.sop-card-cat { font-size:12px; color:#94a3b8; }

.sop-steps-wrap { margin-top:4px; }
.sop-step-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.sop-step-num { font-weight:700; color:#b91c1c; min-width:20px; }

.sop-detail-cat { font-size:13px; color:#94a3b8; margin-bottom:12px; }
.sop-section { margin-bottom:14px; }
.sop-section-title { font-weight:700; font-size:13px; color:#7f1d1d; margin-bottom:4px; }
.sop-list { font-size:14px; line-height:1.7; }
.sop-step-detail { display:flex; align-items:flex-start; gap:10px; padding:8px 0; border-bottom:1px solid #f1f5f9; font-size:14px; }
.sop-step-badge { width:24px; height:24px; border-radius:50%; background:#b91c1c; color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; flex-shrink:0; }

/* Checklist */
.checklist-date { font-weight:700; font-size:16px; margin-bottom:16px; color:#7f1d1d; }
.checklist-section { background:#fff; border-radius:12px; padding:14px; margin-bottom:12px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.checklist-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.checklist-header span:first-child { font-weight:700; font-size:14px; }
.checklist-pct { font-size:12px; color:#64748b; font-weight:600; }
.progress-bar { height:6px; background:#e2e8f0; border-radius:4px; overflow:hidden; margin-bottom:10px; }
.progress-lg { height:10px; border-radius:6px; }
.progress-fill { height:100%; border-radius:4px; transition:width .3s; }
.checklist-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f8fafc; }
.checklist-item.done { opacity:.6; }
.check-btn { background:none; border:none; font-size:18px; cursor:pointer; padding:2px; }
.checklist-text { font-size:14px; }
.text-done { text-decoration:line-through; color:#94a3b8; }

/* ===== People ===== */
.mp-row { display:flex; align-items:center; gap:8px; background:#fff; border-radius:10px; padding:10px 12px; margin-bottom:6px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.mp-icon { font-size:18px; flex-shrink:0; }
.mp-label { flex:1; font-size:13px; font-weight:500; min-width:0; }
.mp-input { width:60px; padding:6px 8px; border:1.5px solid #e2e8f0; border-radius:8px; font-size:15px; font-family:inherit; text-align:center; }
.mp-input:focus { border-color:#7c3aed; outline:none; }
.mp-unit { font-size:12px; color:#94a3b8; }
.mp-total { background:#7f1d1d; color:#fff; border-radius:10px; padding:12px; text-align:center; font-size:16px; font-weight:700; margin-top:10px; }

.train-card { background:#fff; border-radius:12px; padding:14px; margin-bottom:8px; box-shadow:0 1px 3px rgba(0,0,0,.06); position:relative; }
.train-top { display:flex; gap:8px; margin-bottom:4px; }
.train-day { font-weight:700; font-size:13px; color:#7c3aed; }
.train-time { font-size:13px; color:#64748b; }
.train-topic { font-weight:700; font-size:15px; margin-bottom:4px; }
.train-meta { display:flex; gap:16px; font-size:12px; color:#94a3b8; }

.guide-card { background:#fff; border-radius:12px; padding:16px; margin-bottom:12px; box-shadow:0 1px 3px rgba(0,0,0,.06); border-left:4px solid #b91c1c; }
.guide-card.compact { padding:12px; }
.guide-title { font-weight:700; font-size:14px; margin-bottom:8px; }
.guide-step { font-size:13px; padding:3px 0; color:#475569; }
.guide-formula { font-size:15px; font-weight:700; color:#b91c1c; margin-bottom:4px; }
.guide-example { font-size:13px; color:#64748b; font-style:italic; }

.goal-card { background:#fff; border-radius:12px; padding:14px; margin-bottom:8px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.goal-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:4px; }
.goal-text { font-weight:700; font-size:15px; flex:1; }
.goal-meta { font-size:12px; color:#94a3b8; margin-bottom:4px; }
.goal-actions { display:flex; gap:6px; margin-top:8px; }

.fb-types { display:flex; gap:8px; }
.fb-type { flex:1; padding:8px; border-radius:8px; font-size:12px; line-height:1.5; }
.fb-positive { background:#f0fdf4; }
.fb-improve { background:#fef2f2; }

.fb-card { border-radius:12px; padding:14px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.06); position:relative; }
.fb-card-pos { background:#f0fdf4; border-left:4px solid #059669; }
.fb-card-imp { background:#fef2f2; border-left:4px solid #dc2626; }
.fb-card-top { display:flex; justify-content:space-between; font-size:13px; font-weight:600; margin-bottom:4px; }
.fb-date { color:#94a3b8; font-weight:400; }
.fb-employee { font-weight:700; font-size:14px; margin-bottom:6px; }
.fb-text { font-size:13px; line-height:1.8; }
.fb-alt { font-size:13px; margin-top:6px; padding-top:6px; border-top:1px dashed #e2e8f0; line-height:1.8; }

.del-btn { position:absolute; top:8px; right:8px; background:none; border:none; color:#94a3b8; font-size:16px; cursor:pointer; }
.del-btn:hover { color:#ef4444; }

/* ===== Dashboard ===== */
.dash-subtitle { text-align:center; font-size:15px; font-weight:600; color:#64748b; margin-bottom:16px; }
.dash-road { background:#fff; border-radius:12px; padding:14px; margin-bottom:16px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.dash-road-label { display:flex; justify-content:space-between; margin-bottom:8px; font-size:14px; font-weight:600; }

.bsc-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.bsc-card { background:#fff; border-radius:12px; padding:14px; box-shadow:0 1px 3px rgba(0,0,0,.06); cursor:pointer; transition:transform .15s; }
.bsc-card:active { transform:scale(.97); }
.bsc-card-head { display:flex; align-items:center; gap:6px; margin-bottom:8px; }
.bsc-icon { font-size:20px; }
.bsc-title { flex:1; font-weight:700; font-size:14px; }
.bsc-dot { width:10px; height:10px; border-radius:50%; }
.bsc-row { display:flex; justify-content:space-between; padding:3px 0; font-size:12px; }
.bsc-label { color:#94a3b8; }
.bsc-value { font-weight:600; }

.quick-actions { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.quick-btn { display:flex; flex-direction:column; align-items:center; gap:4px; padding:12px 4px; background:#fff; border:none; border-radius:12px; font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.quick-btn:active { transform:scale(.95); }
.quick-icon { font-size:24px; }

/* ===== Roadmap ===== */
.road-progress-card { background:linear-gradient(135deg,#7f1d1d 0%,#b91c1c 60%,#dc2626 100%); border-radius:16px; padding:20px; margin-bottom:20px; color:#fff; }
.road-progress-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.road-progress-num { font-size:36px; font-weight:900; }
.road-progress-label { font-size:14px; opacity:.7; }
.road-badges { display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.road-badge { font-size:20px; background:rgba(255,255,255,.2); width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; }

.road-card { background:#fff; border-radius:12px; padding:14px; margin-bottom:10px; box-shadow:0 1px 3px rgba(0,0,0,.06); display:flex; gap:12px; align-items:flex-start; border-left-width:4px; border-left-style:solid; transition:all .2s; }
.road-card.road-done { opacity:.6; }
.road-card.road-next { box-shadow:0 2px 12px rgba(185,28,28,.15); }
.road-week { width:36px; height:36px; border-radius:50%; color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:800; flex-shrink:0; }
.road-content { flex:1; min-width:0; }
.road-title { font-weight:700; font-size:15px; margin-bottom:2px; }
.road-desc { font-size:13px; color:#64748b; margin-bottom:6px; }
.road-bsc-tag { padding:2px 10px; border-radius:12px; font-size:11px; font-weight:600; display:inline-block; }
.road-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }

.road-complete { text-align:center; padding:40px 20px; }
.road-complete-icon { font-size:64px; margin-bottom:12px; }
.road-complete-text { font-size:18px; font-weight:800; color:#7f1d1d; margin-bottom:4px; }
.road-complete-sub { font-size:14px; color:#64748b; }

/* Learn modal */
.learn-icon { font-size:48px; text-align:center; margin-bottom:8px; }
.learn-week { font-size:14px; font-weight:700; text-align:center; margin-bottom:12px; }
.learn-content { background:#faf5f5; border-radius:10px; padding:14px; font-size:14px; line-height:1.8; }
.learn-bullet { padding-left:8px; }
.learn-para { margin-bottom:4px; }

/* ===== Overview Cards ===== */
.ov-wrapper { margin-bottom:10px; }
.ov-card {
  background:#fff; border-radius:12px; padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between;
  cursor:pointer; transition:transform .15s;
  border-left:4px solid #d1d5db;
}
.ov-card:active { transform:scale(0.98); }
.ov-card.ov-start { border-left-color:#f59e0b; }
.ov-card.ov-good { border-left-color:#2563eb; }
.ov-card.ov-done { border-left-color:#059669; background:#f0fdf4; }
.ov-left { flex:1; }
.ov-name { font-size:15px; font-weight:700; color:#1e293b; }
.ov-stat { font-size:12px; color:#94a3b8; margin-top:2px; }
.ov-right { text-align:right; }
.ov-pct { font-size:22px; font-weight:800; color:#1e293b; }
.ov-card.ov-none .ov-pct { color:#cbd5e1; }
.ov-card.ov-start .ov-pct { color:#f59e0b; }
.ov-card.ov-good .ov-pct { color:#2563eb; }
.ov-card.ov-done .ov-pct { color:#059669; }
.ov-wrapper .progress-bar { margin:4px 16px 0 16px; height:4px; }

.ov-summary {
  background:linear-gradient(135deg,#7f1d1d,#b91c1c);
  border-radius:14px; padding:20px; color:#fff; text-align:center;
}
.ov-summary-label { font-size:13px; opacity:.8; margin-bottom:4px; }
.ov-summary-num { font-size:36px; font-weight:900; }
.ov-summary-detail { font-size:12px; opacity:.7; margin-bottom:10px; }
.ov-summary .progress-bar { background:rgba(255,255,255,.2); }
.ov-summary .progress-fill { background:#fff !important; }

/* ===== Responsive ===== */
@media (max-width:400px) {
  .bsc-grid { grid-template-columns:1fr; }
  .quick-actions { grid-template-columns:repeat(2,1fr); }
  .tab-btn { font-size:12px; padding:6px 10px; }
}
