
/* ===================== Dashboard shell (v2 redesign) ===================== */
.app-shell { display: flex; min-height: 100vh; background: #f8fafc; }

.app-sidebar { width: 260px; flex-shrink: 0; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.app-sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid #1e293b; }
.app-sidebar .brand .logo { width: 34px; height: 34px; border-radius: .5rem; background: #4f46e5;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.app-sidebar .brand-text { line-height: 1.15; }
.app-sidebar .brand-text .name { color: #fff; font-weight: 700; font-size: .95rem; }
.app-sidebar .brand-text .role { color: #64748b; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.app-sidebar .section-label { padding: .9rem 1.25rem .3rem; font-size: .68rem; letter-spacing: .08em;
  text-transform: uppercase; color: #475569; }
.app-sidebar nav { flex: 1; padding: .4rem 0; }
.app-sidebar a.nav-item, .app-sidebar span.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .55rem 1.25rem; font-size: .875rem;
  color: #94a3b8; border-left: 3px solid transparent; }
.app-sidebar a.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.app-sidebar a.nav-item.active { background: #1e293b; color: #fff; border-left-color: #6366f1; }
.app-sidebar span.nav-item.disabled { opacity: .4; cursor: default; }
.app-sidebar .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.app-sidebar .nav-footer { padding: 1rem 1.25rem; border-top: 1px solid #1e293b; }

.app-main { flex: 1; min-width: 0; }
.app-topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center; }
.app-topbar h1 { margin: 0; font-size: 1.4rem; font-weight: 700; color: #0f172a; }
.app-topbar .subtitle { font-size: .82rem; color: #64748b; margin-top: .15rem; }
.app-content { padding: 1.75rem 2rem; }

.avatar-circle { width: 38px; height: 38px; border-radius: 9999px; background: #e0e7ff; color: #4338ca;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: .75rem; padding: 1.1rem 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex; align-items: flex-start; gap: .8rem; }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: .6rem; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; }
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1.1; }
.stat-card .stat-label { font-size: .78rem; color: #64748b; margin-top: .15rem; }
.stat-card .stat-sub { font-size: .72rem; margin-top: .3rem; }
.stat-sub.up { color: #16a34a; }
.stat-sub.warn { color: #d97706; }
.stat-sub.down { color: #dc2626; }

.icon-indigo { background: #e0e7ff; color: #4f46e5; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-red { background: #fee2e2; color: #dc2626; }
.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-pink { background: #fce7f3; color: #db2777; }
.icon-slate { background: #f1f5f9; color: #475569; }

/* Panel cards */
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.panel-grid.cols-3 { grid-template-columns: 1.2fr 1.2fr 1fr; }
.panel-grid.cols-2 { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 1100px) { .panel-grid.cols-3, .panel-grid.cols-2 { grid-template-columns: 1fr; } }
.panel-card { background: #fff; border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel-card h2 { font-size: 1rem; font-weight: 700; margin: 0 0 .9rem; color: #0f172a; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; }
.panel-link { font-size: .8rem; color: #4f46e5; font-weight: 600; }

/* Table-ish list rows */
.row-list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid #f1f5f9; }
.row-item:last-child { border-bottom: none; }
.row-item .thumb { width: 40px; height: 40px; border-radius: .5rem; object-fit: cover; background: #e2e8f0; flex-shrink: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: .85rem; font-weight: 600; color: #1e293b; }
.row-sub { font-size: .75rem; color: #94a3b8; }
.row-end { text-align: right; font-size: .75rem; }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 9999px; font-size: .7rem; font-weight: 600; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }

/* Progress bar */
.progress-track { width: 100%; background: #eef2f7; border-radius: 9999px; height: .55rem; overflow: hidden; }
.progress-fill { background: #6366f1; height: 100%; border-radius: 9999px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: .5rem;
  font-size: .85rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-outline { background: #fff; color: #334155; border-color: #e2e8f0; }
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }

/* Photo grid (customer selection) */
.photo-select-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; background: #f8fafc; }
.photo-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.photo-tile { position: relative; background: #fff; border-radius: .6rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.photo-tile img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.photo-tile .checkbox { position: absolute; top: .5rem; left: .5rem; width: 22px; height: 22px; border-radius: .3rem;
  background: rgba(255,255,255,.85); border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo-tile .checkbox.checked { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.photo-tile .heart { position: absolute; top: .5rem; right: .5rem; width: 22px; height: 22px; display: flex;
  align-items: center; justify-content: center; cursor: pointer; color: #cbd5e1; }
.photo-tile .heart.active { color: #ec4899; }
.photo-tile .filename { padding: .4rem .5rem; font-size: .72rem; color: #64748b; }

.chip-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: #ecfdf5; color: #065f46;
  border-radius: .6rem; font-size: .85rem; margin-bottom: 1rem; }
.chip-bar strong { color: #047857; }

svg.chart { display: block; }

/* ===================== Drag & drop uploader ===================== */
.dropzone { border: 2px dashed #c7d2fe; border-radius: .75rem; padding: 2rem 1rem; text-align: center;
  background: #f8fafc; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.dragover { border-color: #6366f1; background: #eef2ff; }
.dropzone svg { width: 36px; height: 36px; margin: 0 auto .5rem; color: #6366f1; }
.dropzone .dz-text { font-size: .85rem; color: #475569; }
.dropzone .dz-sub { font-size: .72rem; color: #94a3b8; margin-top: .25rem; }

.upload-progress-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; max-height: 260px; overflow-y: auto; }
.upload-progress-item { display: flex; align-items: center; gap: .6rem; font-size: .78rem; }
.upload-progress-item .name { flex: 0 0 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #475569; }
.upload-progress-item .bar-track { flex: 1; background: #eef2f7; border-radius: 9999px; height: .4rem; overflow: hidden; }
.upload-progress-item .bar-fill { background: #6366f1; height: 100%; border-radius: 9999px; transition: width .15s; }
.upload-progress-item .bar-fill.error { background: #dc2626; }
.upload-progress-item .bar-fill.done { background: #16a34a; }
.upload-progress-item .pct { flex: 0 0 38px; text-align: right; color: #94a3b8; }
.upload-summary { display: flex; gap: 1.5rem; margin-top: 1rem; font-size: .78rem; color: #64748b; }
.upload-summary strong { color: #1e293b; }

/* ===================== Polished auth screens ===================== */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #ede9fe 100%); padding: 2rem; }
.auth-card { background: #fff; border-radius: 1rem; padding: 2.5rem 2.25rem; width: 100%; max-width: 420px;
  box-shadow: 0 10px 40px rgba(79,70,229,.12); text-align: center; }
.auth-logo { width: 64px; height: 64px; border-radius: 1rem; background: linear-gradient(135deg,#6366f1,#4338ca);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; color: #fff; }
.auth-logo svg { width: 34px; height: 34px; }
.auth-badge { display: inline-block; background: #4f46e5; color: #fff; font-size: .65rem; font-weight: 700;
  letter-spacing: .06em; padding: .2rem .6rem; border-radius: 9999px; margin-top: .3rem; }
.auth-field { text-align: left; margin-bottom: 1rem; }
.auth-field label { font-size: .8rem; font-weight: 600; color: #334155; display: block; margin-bottom: .3rem; }
.auth-input-wrap { position: relative; }
.auth-input-wrap svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #94a3b8; }
.auth-input-wrap input { width: 100%; padding: .65rem .8rem .65rem 2.4rem; border: 1px solid #e2e8f0; border-radius: .5rem; font-size: .9rem; }
.auth-input-wrap .toggle-eye { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); cursor: pointer; color: #94a3b8; width: 18px; height: 18px; }
.auth-divider { display: flex; align-items: center; gap: .8rem; margin: 1.2rem 0; color: #94a3b8; font-size: .75rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #eef2f7; }

.otp-boxes { display: flex; gap: .5rem; justify-content: center; margin: 1.2rem 0 .6rem; }
.otp-boxes input { width: 46px; height: 54px; text-align: center; font-size: 1.4rem; font-weight: 700;
  border: 2px solid #e2e8f0; border-radius: .5rem; }
.otp-boxes input:focus { border-color: #6366f1; outline: none; }
.otp-timer { font-size: .78rem; color: #94a3b8; margin-bottom: 1rem; }
.otp-timer strong { color: #4f46e5; }

/* ===================== Customer code+email login (split panel) ===================== */
.split-login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f8fafc; padding: 2rem; }
.split-login-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; max-width: 820px; width: 100%; }
.split-login-main { background: #fff; border-radius: 1rem; padding: 2.5rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.split-login-side { background: #fff; border-radius: 1rem; padding: 1.75rem; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.how-step { display: flex; gap: .8rem; margin-bottom: 1.2rem; }
.how-step .num { width: 26px; height: 26px; border-radius: 9999px; background: #e0e7ff; color: #4338ca;
  display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.how-step .txt { font-size: .82rem; color: #475569; }
.how-step .txt strong { display: block; color: #1e293b; font-size: .85rem; margin-bottom: .1rem; }
@media (max-width: 720px) { .split-login-grid { grid-template-columns: 1fr; } }
