/* Micro ERP — production layout system */

:root {
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.2);
  --sidebar-bg: #111827;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1e293b;
  --header-h: 60px;
  --sidebar-w: 252px;
  --page-pad: 24px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.brand-icon { width: 34px; height: 34px; flex: 0 0 34px; color: var(--primary); }
.brand-icon svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text strong { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 10px; font-weight: 500; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand--compact .brand-text { display: none; }

.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: var(--header-h);
  padding: 0 var(--page-pad);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.header-left, .header-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-left { flex: 1; }
.header-right { flex-shrink: 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-2); flex-shrink: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.sidebar-toggle { display: none; }

.admin-block { position: relative; }
.admin-trigger {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.admin-trigger[aria-expanded="true"] { border-color: #cbd5e1; box-shadow: var(--shadow); }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); flex-shrink: 0;
}
.admin-meta { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.admin-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.admin-role { font-size: 11px; color: var(--text-3); text-transform: capitalize; }
.admin-caret { font-size: 10px; color: var(--text-3); flex-shrink: 0; }
.admin-datetime { display: block; margin-top: 2px; padding-right: 6px; font-size: 10px; color: var(--text-3); text-align: right; white-space: nowrap; }
.admin-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  width: min(240px, calc(100vw - 32px)); padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); z-index: 60;
}
.admin-dropdown.show { display: block; }
.admin-dropdown-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border-light); margin-bottom: 4px; }
.admin-dropdown-head strong { display: block; font-size: 13px; color: var(--text); }
.admin-dropdown-head span { font-size: 11px; color: var(--text-3); }
.admin-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-2); }
.admin-dropdown a svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-dropdown a:hover { background: var(--bg); color: var(--text); }
.admin-dropdown a.danger:hover { background: #fef2f2; color: #b91c1c; }
.admin-dropdown-time { display: none; padding: 8px 12px 4px; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--border-light); margin-top: 4px; }
.gear-link:hover { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary); }

.app-frame { display: flex; align-items: stretch; min-height: calc(100dvh - var(--header-h)); }
.app-sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  padding: 16px 12px calc(16px + var(--safe-bottom));
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto; overscroll-behavior: contain;
}
.sidebar-brand { display: flex; align-items: center; gap: 6px; height: 32px; margin-bottom: 16px; padding: 0 6px; }
.sidebar-back { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; color: var(--sidebar-text); flex-shrink: 0; }
.sidebar-back:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-back svg { width: 14px; height: 14px; }
.sidebar-title { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: #f8fafc; line-height: 1; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item, .nav-sub, .nav-group-toggle {
  display: flex; align-items: center; width: 100%;
  border-radius: var(--radius); color: var(--sidebar-text);
  font-size: 13px; font-weight: 500; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item, .nav-group-toggle { padding: 10px; }
.nav-sub { padding: 8px 10px 8px 36px; font-size: 12px; }
.nav-icon { width: 18px; height: 18px; margin-right: 10px; flex-shrink: 0; opacity: 0.85; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { flex: 1; min-width: 0; }
.nav-item:hover, .nav-sub:hover, .nav-group-toggle:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-item.active, .nav-sub.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.nav-item.active .nav-icon, .nav-sub.active .nav-icon { opacity: 1; }
.nav-group { margin-top: 8px; }
.nav-group-toggle { justify-content: space-between; }
.nav-group-label { display: flex; align-items: center; min-width: 0; }
.nav-caret { font-size: 10px; opacity: 0.7; transition: transform 0.15s; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-group-items { display: none; }
.nav-group.open .nav-group-items { display: block; }
.sidebar-overlay { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(15, 23, 42, 0.5); z-index: 45; }
.sidebar-overlay.show { display: block; }

.app-main, .page-main { flex: 1; min-width: 0; background: var(--bg); }
.page-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px var(--page-pad) calc(32px + var(--safe-bottom)); }
.page-container--narrow { max-width: 720px; }

.page-eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head--stack { align-items: flex-start; }
.page-head h1, .landing-hero h1 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.lead, .muted { margin: 0; font-size: 14px; color: var(--text-3); }
.back-link { display: inline-block; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.back-link:hover { color: var(--text); }
h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.page-actions { margin-bottom: 16px; }
.page-head .btn, .page-head .btn.primary { flex-shrink: 0; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.stat-card-label { font-size: 12px; font-weight: 500; color: var(--text-3); }
.stat-card-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-card-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-card-icon.green { background: #ecfdf5; color: #059669; }
.stat-card-icon.amber { background: #fffbeb; color: #d97706; }
.stat-card-icon.violet { background: #f5f3ff; color: #7c3aed; }
.stat-card strong { display: block; font-size: clamp(24px, 4vw, 30px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.stat-card-trend { margin-top: 6px; font-size: 11px; color: var(--text-3); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-light); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
thead { background: #f8fafc; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
th { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.tracking-cell { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-state { padding: 24px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: #475569; }
.badge-booked { background: #eff6ff; color: #1d4ed8; }
.badge-picked { background: #fffbeb; color: #b45309; }
.badge-transit { background: #f5f3ff; color: #6d28d9; }
.badge-delivered { background: #ecfdf5; color: #047857; }
.badge-cancelled { background: #fef2f2; color: #b91c1c; }
.badge-admin { background: #eff6ff; color: #1d4ed8; }
.badge-user { background: #f1f5f9; color: #475569; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.status-dot.active { background: #10b981; }
.status-dot.inactive { background: #94a3b8; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.btn:hover { background: var(--bg); color: var(--text); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.small { min-height: 34px; padding: 0 10px; font-size: 12px; }

.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-form.single-col { grid-template-columns: 1fr; }
.grid-form label, .auth-form label, .search-form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
.grid-form input, .auth-form input, .grid-form select, .inline-form select, .search-form input, .password-form input {
  display: block; width: 100%; margin-top: 6px; min-height: 42px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.grid-form input:focus, .auth-form input:focus, .grid-form select:focus, .search-form input:focus, .password-form input:focus {
  outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-end { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.inline-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form select { width: auto; min-width: 0; margin: 0; max-width: 140px; }
.actions-cell { min-width: 180px; }
.password-form { margin-top: 6px; width: 100%; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.alert.success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.landing-hero { margin-bottom: 22px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.module-card {
  display: flex; flex-direction: column; gap: 10px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); min-height: 150px; transition: border-color 0.15s, box-shadow 0.15s;
}
.module-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-md); }
.module-card-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.module-card-icon svg { width: 22px; height: 22px; }
.module-card strong { font-size: 17px; font-weight: 700; }
.module-card p { margin: 0; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.module-card-arrow { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--primary); }

.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; }
.auth-brand-panel {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(24px, 5vw, 48px); color: #fff;
  background: linear-gradient(160deg, #0f172a 0%, #1e40af 60%, #2563eb 100%);
}
.auth-brand-panel .brand { color: #fff; margin-bottom: 40px; }
.auth-brand-panel .brand-text small { color: rgba(255,255,255,0.7); }
.auth-brand-panel h1 { margin: 0 0 12px; font-size: clamp(28px, 4vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; max-width: 400px; }
.auth-brand-panel p { margin: 0; max-width: 400px; font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.85); }
.auth-brand-footer { font-size: 12px; color: rgba(255,255,255,0.5); }
.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: clamp(20px, 4vw, 40px); background: var(--bg); }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { margin: 0 0 4px; font-size: clamp(22px, 4vw, 26px); font-weight: 700; letter-spacing: -0.02em; }
.auth-subtitle { margin: 0 0 24px; color: var(--text-3); font-size: 14px; }
.auth-form label { margin-bottom: 14px; }
.auth-form .btn { width: 100%; min-height: 44px; margin-top: 4px; }
.auth-mobile-brand { display: none; margin-bottom: 20px; }

.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,0.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(10px); }
.topbar-inner { max-width: 1280px; margin: 0 auto; min-height: var(--header-h); padding: 0 var(--page-pad); display: flex; align-items: center; gap: 16px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 8px 12px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-3); }
.topbar nav a:hover { background: var(--bg); color: var(--text); }
.user-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--text-2); max-width: 50%; }
.user-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-3); border: 1px solid transparent; }
.tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

body.sidebar-open { overflow: hidden; }

/* Booking / customer forms */
.hidden { display: none !important; }
.booking-form label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 0; }
.booking-form input,
.booking-form select,
.booking-form textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 42px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.form-section { display: grid; gap: 14px; }
.field-row { display: grid; gap: 14px; }
.field-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 10;
  padding: 14px var(--page-pad); margin: 0 calc(var(--page-pad) * -1);
  background: rgba(244, 246, 250, 0.95); border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.search-results { display: grid; gap: 6px; margin-bottom: 12px; }
.search-result-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.search-result-item:hover { border-color: #93c5fd; background: var(--primary-soft); }
.search-result-item span { font-size: 12px; color: var(--text-3); }
.selected-card {
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid #bfdbfe; border-radius: var(--radius); background: var(--primary-soft);
}
.inline-create { margin-top: 12px; border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 12px; }
.inline-create summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.package-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px; margin-bottom: 12px; background: #fafbfc;
}
.package-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.checkbox-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 30px; font-size: 13px; font-weight: 500; }
.checkbox-line input { width: auto; min-height: auto; margin: 0; }

/* Structured ERP forms */
.erp-form { display: grid; gap: 16px; }
.form-panel { margin-bottom: 0; }
.form-panel-head { margin-bottom: 16px; }
.form-panel-head h2 { margin: 0 0 4px; }
.form-panel-head .muted { margin: 0; }
.form-panel-head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.form-panel-head--row .btn {
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}
.booking-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.booking-toolbar h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.booking-toolbar .btn {
  flex-shrink: 0;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.choice-grid--compact { margin-bottom: 0; }
.choice-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.choice-card input { margin-top: 3px; flex-shrink: 0; accent-color: var(--primary); }
.choice-card-body { display: grid; gap: 4px; min-width: 0; }
.choice-card-body strong { font-size: 14px; color: var(--text); }
.choice-card-body span { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.choice-card.is-selected,
.choice-card:has(input:checked) {
  border-color: #93c5fd;
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.choice-card--sm { padding: 12px; }
.field-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.field-grid:last-child { margin-bottom: 0; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: block; min-width: 0; }
.field-label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.field-label em { color: #dc2626; font-style: normal; }
.field input,
.field select,
.field textarea {
  display: block; width: 100%; min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; border-color: #93c5fd; box-shadow: 0 0 0 3px var(--primary-ring);
}
.input-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: 0.04em; }
.input-locked {
  background: #f1f5f9 !important;
  color: var(--text-2);
  cursor: not-allowed;
}
.phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f1f5f9;
  border-right: 1px solid var(--border);
  font-weight: 650;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.phone-input input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}
.items-table-wrap, .rate-table { margin-top: 4px; }
.items-table, .rate-table, .packages-table { min-width: 720px; }
.items-table th, .rate-table th, .packages-table th { white-space: nowrap; }
.items-table td, .rate-table td, .packages-table td { padding: 8px; vertical-align: middle; }
.items-table input,
.items-table select,
.packages-table input,
.packages-table select,
.rate-table input {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.item-row td:last-child,
.package-row td:last-child { text-align: center; }
.section-subhead {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}
.field-block {
  margin-top: 4px; margin-bottom: 14px; padding: 14px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: #f8fafc;
}
.field-block-title {
  margin-bottom: 12px; font-size: 12px; font-weight: 700;
  color: var(--text); letter-spacing: 0.02em;
}
.field-block .field-grid { margin-bottom: 0; }
.field--checkbox .check-line,
.check-line {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; font-size: 13px; font-weight: 500; color: var(--text-2);
}
.check-line input { width: auto; min-height: auto; margin: 0; }
.form-footer {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 4px 0 8px;
}
.form-footer--inline { justify-content: flex-start; margin-top: 4px; }
.count-pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: #eef2ff; color: #3730a3;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.receiver-list { display: grid; gap: 10px; margin-bottom: 16px; }
.receiver-card {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fafbfc;
}
.receiver-card-main { min-width: 0; }
.receiver-card-main strong { margin-right: 8px; }
.receiver-card-main p { margin: 4px 0 0; font-size: 13px; }
.receiver-card-meta { font-size: 12px; white-space: nowrap; }
.form-drawer {
  border: 1px dashed #cbd5e1; border-radius: var(--radius-lg);
  padding: 12px 14px; background: #fff;
}
.form-drawer summary {
  cursor: pointer; font-weight: 600; color: var(--primary); list-style: none;
}
.form-drawer summary::-webkit-details-marker { display: none; }
.form-drawer[open] summary { margin-bottom: 14px; }
.receiver-form { gap: 0; }

@media (max-width: 900px) {
  .field-grid--3, .field-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .choice-grid, .field-grid--2, .field-grid--3, .field-grid--4 { grid-template-columns: 1fr; }
  .receiver-card { flex-direction: column; }
  .form-footer .btn { flex: 1; }
  .form-panel-head--row { flex-direction: column; }
}

@media (max-width: 768px) {
  .field-row--2, .field-row--3, .field-row--4 { grid-template-columns: 1fr; }
  .sticky-actions .btn { flex: 1; }
}

@media (max-width: 1280px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  :root { --page-pad: 20px; }
  .app-header--module .sidebar-toggle { display: inline-flex; }
  .app-sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 48; transform: translateX(-105%); transition: transform 0.2s ease; box-shadow: var(--shadow-md); }
  .app-sidebar.open { transform: translateX(0); }
  .report-grid { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  :root { --page-pad: 16px; --header-h: 56px; }
  .brand-text { display: none; }
  .admin-meta { display: none; }
  .admin-caret { display: none; }
  .admin-trigger { padding: 4px; border-radius: 50%; }
  .admin-datetime { display: none; }
  .admin-dropdown-time { display: block; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn { width: 100%; }
  .grid-form { grid-template-columns: 1fr; }
  .form-end .btn { flex: 1; }
  .search-form { grid-template-columns: 1fr; }
  .search-form .btn { width: 100%; }
  .inline-form { flex-direction: column; align-items: stretch; width: 100%; }
  .inline-form select, .inline-form .btn { width: 100%; max-width: none; }
  .actions-cell { min-width: 0; }
  .topbar nav { display: none; }
  .user-pill { max-width: none; }
}
@media (max-width: 640px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-mobile-brand { display: block; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .panel { padding: 14px; }
  th, td { padding: 10px 12px; }
}
@media (max-width: 430px) { .cards { grid-template-columns: 1fr; } .module-grid { grid-template-columns: 1fr; } .page-container { padding-top: 18px; } }
@media (max-width: 390px) { :root { --page-pad: 14px; } .icon-btn, .sidebar-toggle { width: 38px; height: 38px; } }
@media (max-width: 375px) { .stat-card strong { font-size: 22px; } .admin-avatar { width: 30px; height: 30px; font-size: 10px; } }
