:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #1f2a37;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef3ff, #f7f8fb);
}

body.auth-screen {
  position: relative;
  background: linear-gradient(180deg, #f4f2ef, #f8f6f2);
}

body.auth-screen::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #f4f2ef, #f8f6f2);
  pointer-events: none;
}

body.auth-screen::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(250, 248, 244, 0.26) 0%, rgba(250, 248, 244, 0.14) 100%);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 16px;
}

.topbar,
.card,
.nav-btn {
  border-radius: 18px;
}

.topbar,
.card {
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.topbar {
  position: relative;
  z-index: 40;
  overflow: visible;
  isolation: isolate;
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #fbf8f3 0%, #f6f0e6 100%);
  border: 1px solid rgba(186, 163, 135, 0.18);
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url('./images/boloni-login-bg.jpg');
  background-repeat: no-repeat;
  background-size: 122% auto;
  background-position: 82% center;
  opacity: 0.98;
  z-index: -2;
}

.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(252, 249, 245, 0.88) 0%, rgba(252, 249, 245, 0.72) 34%, rgba(252, 249, 245, 0.38) 62%, rgba(252, 249, 245, 0.10) 100%);
  z-index: -1;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

body.auth-screen .topbar,
body.auth-screen #loginView,
body.auth-screen #registerView,
body.auth-screen #changePasswordView {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 18px 42px rgba(120, 104, 78, 0.12);
}

body.auth-screen .topbar {
  background: linear-gradient(135deg, rgba(251, 248, 243, 0.92) 0%, rgba(246, 240, 230, 0.88) 100%);
}

body.auth-screen .topbar {
  margin-top: 12px;
}

body.auth-screen #loginView,
body.auth-screen #registerView,
body.auth-screen #changePasswordView {
  max-width: 760px;
}

.auth-card {
  padding: 26px 24px 22px;
}


.auth-card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0.02em;
}

.auth-lead {
  margin: 8px 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #7c7366;
}

.auth-card label {
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #645846;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  border-color: rgba(190, 174, 152, 0.42);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-card input::placeholder {
  color: #a29a8d;
}

.auth-card .actions {
  margin-top: 20px;
  gap: 10px;
}

.auth-card .actions button {
  min-height: 46px;
  flex: 1 1 0;
}

.auth-meta-line {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(190, 174, 152, 0.28);
  font-size: 12px;
  line-height: 1.6;
  color: #8a7c69;
}

body.auth-screen #loginView h2,
body.auth-screen #registerView h2,
body.auth-screen #changePasswordView h2 {
  color: #2b3442;
}

body.auth-screen .brand-sub,
body.auth-screen .topbar p,
body.auth-screen .meta,
body.auth-screen small {
  color: #7c7366;
}

.topbar h1,
.card h2,
.panel-block h3 {
  margin: 0 0 6px;
}

.topbar p {
  margin: 0;
  color: #64748b;
}

.topbar-actions {
  position: relative;
  z-index: 45;
  overflow: visible;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sales-compact-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: #6b5d4b;
  font-size: 12px;
  line-height: 1.4;
}

.sales-compact-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.sales-compact-item strong {
  color: #4b3b2a;
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
}

.card {
  padding: 18px;
  margin-bottom: 16px;
}

.home-summary-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fbf8f3 0%, #f6f0e6 100%);
  border: 1px solid rgba(186, 163, 135, 0.18);
  box-shadow: 0 14px 30px rgba(120, 104, 78, 0.10);
  padding: 16px 18px 14px;
}

.home-summary-card::before,
.home-summary-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-summary-card::before {
  background-image: url('./images/boloni-login-bg.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: right center;
  opacity: 0.24;
}

.home-summary-card::after {
  background: linear-gradient(90deg, rgba(252, 249, 245, 0.97) 0%, rgba(252, 249, 245, 0.90) 34%, rgba(252, 249, 245, 0.62) 64%, rgba(252, 249, 245, 0.22) 100%);
}

.home-summary-head,
.home-summary-grid {
  position: relative;
  z-index: 1;
}

.home-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.home-summary-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(123, 92, 58, 0.10);
  border: 1px solid rgba(123, 92, 58, 0.14);
  color: #7b5c3a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-summary-label {
  color: #8a7c69;
  font-size: 13px;
  margin-bottom: 6px;
}

.home-summary-total {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.home-summary-store {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(186, 163, 135, 0.18);
  color: #6b5d4b;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.home-summary-value {
  font-size: 38px;
  line-height: 0.92;
  font-weight: 800;
  color: #4b3b2a;
  letter-spacing: -0.04em;
}

.home-summary-unit {
  padding-bottom: 3px;
  color: #8a7c69;
  font-size: 13px;
  font-weight: 600;
}

.home-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-summary-item {
  position: relative;
  border-radius: 15px;
  padding: 12px 14px 11px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(186, 163, 135, 0.16);
  box-shadow: 0 8px 18px rgba(120, 104, 78, 0.08);
  backdrop-filter: blur(8px);
}

.home-summary-item::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.home-summary-item-label {
  color: #8a7c69;
  font-size: 12px;
  margin-bottom: 8px;
  padding-left: 14px;
}

.home-summary-item-value {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 800;
  color: #4b3b2a;
}

.home-summary-item.is-a-plus {
  background: linear-gradient(180deg, rgba(245, 251, 246, 0.94), rgba(255, 255, 255, 0.78));
  border-color: rgba(134, 185, 149, 0.34);
}

.home-summary-item.is-a-plus::before {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.10);
}

.home-summary-item.is-a-plus .home-summary-item-value {
  color: #4f6b55;
}

.home-summary-item.is-c-plus {
  background: linear-gradient(180deg, rgba(242, 246, 252, 0.94), rgba(255, 255, 255, 0.78));
  border-color: rgba(144, 171, 205, 0.36);
}

.home-summary-item.is-c-plus::before {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.home-summary-item.is-c-plus .home-summary-item-value {
  color: #4e6586;
}

.home-summary-item.is-due {
  background: linear-gradient(180deg, rgba(252, 245, 238, 0.95), rgba(255, 255, 255, 0.78));
  border-color: rgba(216, 170, 126, 0.34);
}

.home-summary-item.is-due::before {
  background: #ea580c;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.10);
}

.home-summary-item.is-due .home-summary-item-value {
  color: #8f5a3a;
}

.panel-block {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
  background: #fbfdff;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #334155;
}

input,
textarea,
button,
select {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #dbe2f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
}

.password-toggle:hover {
  background: #eef2ff;
  color: #334155;
}

.password-toggle.active {
  color: #2563eb;
}

.password-toggle-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 12px 12px 10px 10px / 10px 10px 8px 8px;
}

.password-toggle-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-toggle-icon::after {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%) rotate(-28deg);
}

.password-toggle.active .password-toggle-icon::after {
  background: currentColor;
}

button {
  border: 0;
  background: #6b7280;
  color: #fff;
  padding: 12px 16px;
  cursor: pointer;
}

button.ghost {
  background: #e5e7eb;
  color: #374151;
}

button.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 12px;
  border: 1px solid #fecaca;
  box-shadow: 0 1px 2px rgba(185, 28, 28, 0.08);
}

.nav-btn {
  min-height: 92px;
  font-size: 18px;
}

.home-action-grid {
  margin-top: 2px;
}

.home-action-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 18px;
  text-align: left;
  color: #0f172a;
  border: 1px solid rgba(219, 234, 254, 0.95);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  box-shadow: 0 14px 28px rgba(148, 163, 184, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(100, 116, 139, 0.18);
}

.home-action-card::before {
  content: '';
  position: absolute;
  right: -22px;
  top: -22px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  opacity: 0.22;
}

.home-action-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.home-action-title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.home-action-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
  max-width: 19em;
}

.home-action-card.action-create {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), #ffffff);
}

.home-action-card.action-create::before {
  background: #60a5fa;
}

.home-action-card.action-create .home-action-badge {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.home-action-card.action-mine {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.98), #ffffff);
}

.home-action-card.action-mine::before {
  background: #818cf8;
}

.home-action-card.action-mine .home-action-badge {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
}

.home-action-card.action-followup {
  border-color: #fed7aa;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.98), #ffffff);
}

.home-action-card.action-followup::before {
  background: #fb923c;
}

.home-action-card.action-followup .home-action-badge {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
}

#serviceDispatcherOverdueBtn.home-action-card,
#serviceSupervisorOverdueBtn.home-action-card {
  border-color: #fecaca;
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), #ffffff);
}

#serviceDispatcherOverdueBtn.home-action-card::before,
#serviceSupervisorOverdueBtn.home-action-card::before {
  background: #ef4444;
}

#serviceDispatcherOverdueBtn.home-action-card .home-action-badge,
#serviceSupervisorOverdueBtn.home-action-card .home-action-badge {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

#serviceDispatcherOverdueBtn.home-action-card .home-action-title,
#serviceSupervisorOverdueBtn.home-action-card .home-action-title {
  color: #7f1d1d;
}

#serviceDispatcherOverdueBtn.home-action-card .home-action-desc,
#serviceSupervisorOverdueBtn.home-action-card .home-action-desc {
  color: #991b1b;
}

.home-action-card.action-admin {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), #ffffff);
}

.home-action-card.action-admin::before {
  background: #4ade80;
}

.home-action-card.action-admin .home-action-badge {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

#adminEntryBtn.home-action-card {
  color: #0f172a;
  border-color: #bbf7d0;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), #ffffff);
}

#adminEntryBtn.home-action-card .home-action-title {
  color: #0f172a;
}

#adminEntryBtn.home-action-card .home-action-desc {
  color: #64748b;
}

.home-secondary-entry {
  margin-top: 12px;
}

.home-reminder-card {
  margin-top: 12px;
  border: 1px solid rgba(186, 163, 135, 0.18);
  background: linear-gradient(135deg, rgba(251, 248, 243, 0.96) 0%, rgba(246, 240, 230, 0.92) 100%);
  box-shadow: 0 12px 28px rgba(120, 104, 78, 0.08);
}

.home-reminder-head {
  margin-top: 0;
}

.home-reminder-head h3 {
  margin: 0 0 4px;
  color: #4b3b2a;
}

.home-reminder-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.home-reminder-stat {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(186, 163, 135, 0.16);
}

.home-reminder-stat-label {
  display: block;
  font-size: 12px;
  color: #8a7c69;
  margin-bottom: 6px;
}

.home-reminder-stat-value {
  font-size: 24px;
  line-height: 1;
  color: #4b3b2a;
}

.home-reminder-stat.is-overdue .home-reminder-stat-value,
.home-reminder-tag.is-overdue {
  color: #b45309;
}

.home-reminder-stat.is-today .home-reminder-stat-value,
.home-reminder-tag.is-today {
  color: #c2410c;
}

.home-reminder-stat.is-upcoming .home-reminder-stat-value,
.home-reminder-tag.is-upcoming {
  color: #7b5c3a;
}

.home-reminder-list {
  margin-top: 12px;
}

.home-reminder-item {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(186, 163, 135, 0.16);
  box-shadow: 0 8px 18px rgba(120, 104, 78, 0.06);
}

.home-reminder-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.home-reminder-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(123, 92, 58, 0.10);
  font-size: 12px;
  font-weight: 700;
}

.home-action-card-wide {
  width: 100%;
  min-height: 118px;
}

.home-action-card.action-analysis {
  border-color: rgba(186, 163, 135, 0.28);
  background: linear-gradient(135deg, rgba(251, 248, 243, 0.98) 0%, rgba(246, 240, 230, 0.98) 100%);
  box-shadow: 0 14px 28px rgba(120, 104, 78, 0.10);
}

.home-action-card.action-analysis::before {
  background: #b08968;
}

.home-action-card.action-analysis .home-action-badge {
  background: rgba(123, 92, 58, 0.10);
  color: #7b5c3a;
}

.home-action-card.action-analysis .home-action-title {
  color: #4b3b2a;
}

.home-action-card.action-analysis .home-action-desc {
  color: #7c7366;
  max-width: 32em;
}

#myCustomersView .my-customer-filters {
  gap: 10px 12px;
}

#myCustomersView .my-customer-filters label {
  gap: 6px;
  font-size: 13px;
}

#myCustomersView .my-customer-filters input,
#myCustomersView .my-customer-filters select {
  min-height: 42px;
  padding: 10px 12px;
}

#myCustomersView .search-summary {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

#followupView .followup-top-actions {
  margin-top: 0;
}

#followupView .followup-filters {
  gap: 10px 12px;
}

#followupView .followup-filters label {
  gap: 6px;
  font-size: 13px;
}

#followupView .followup-filters select {
  min-height: 42px;
  padding: 10px 12px;
}

#followupView .search-summary {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

#adminView .admin-filters {
  gap: 10px 12px;
}

#adminView .admin-filters label {
  gap: 6px;
  font-size: 13px;
}

#adminView .admin-filters input,
#adminView .admin-filters select {
  min-height: 42px;
  padding: 10px 12px;
}

#adminView .admin-filter-actions {
  gap: 8px;
}

#adminView .admin-filter-actions button {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 13px;
}

#adminView .search-summary {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 13px;
}


.admin-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-entry-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: #0f172a;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.admin-entry-card:hover {
  border-color: #cbd5e1;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
  transform: translateY(-1px);
}

.admin-entry-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
}

.admin-entry-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}

.admin-entry-desc {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.admin-entry-summary {
  width: 100%;
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

#operationLogsView .search-summary,
#userManagementView .search-summary,
#adminDashboardView .search-summary {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

#customerDetailView .panel-block {
  padding: 14px;
}

#customerDetailView .detail-actions {
  margin-top: 12px;
}

#customerDetailView .detail-actions button,
#customerDetailView .detail-actions .button-link {
  min-height: 40px;
  padding: 10px 12px;
  font-size: 13px;
}

#customerDetailView .detail-footer-actions {
  margin-top: 12px;
}

.checkbox {
  flex-direction: row;
  align-items: center;
}

.checkbox input {
  width: auto;
}

.actions,
.inline-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.list-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #fafcff;
}

.list-item h3,
.list-item p {
  margin: 0 0 8px;
}

.list-item .meta {
  color: #64748b;
  font-size: 13px;
}

.compact-item p:last-child {
  margin-bottom: 0;
}

.attachment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.attachment-chip.is-video {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.attachment-preview {
  position: relative;
  margin: 10px 0 12px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a, #111827);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.attachment-preview-meta {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.attachment-preview-label,
.attachment-duration {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.attachment-preview.is-ready .attachment-duration {
  background: rgba(185, 28, 28, 0.78);
}

.attachment-preview video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 360px;
  object-fit: cover;
  background: #000000;
}

.attachment-actions {
  margin-top: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  gap: 10px 16px;
  margin-bottom: 14px;
  color: #334155;
  line-height: 1.6;
}

.detail-block {
  margin-top: 12px;
  color: #334155;
  line-height: 1.7;
}

.detail-block strong {
  display: block;
  margin-bottom: 4px;
}

.service-ticket-item {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.service-ticket-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.service-ticket-item.is-highlighted {
  border: 1.5px solid #f59e0b;
  background: #fffaf0;
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.18);
}

.service-dispatch-hint {
  margin: -2px 0 12px;
  line-height: 1.6;
}

.service-dispatch-quick-actions {
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.service-dispatch-quick-actions .ghost {
  min-height: 40px;
}

.service-dispatch-installer-hint {
  display: block;
  margin-top: 6px;
  line-height: 1.6;
}

.service-tickets-quick-hint {
  margin: -2px 0 14px;
  line-height: 1.6;
}

.service-home-panel {
  margin-top: 16px;
}

.service-alert-banner {
  margin: 14px 0 10px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(220, 38, 38, 0.34);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(185, 28, 28, 0.96));
  color: #fff7f7;
  line-height: 1.65;
  box-shadow: 0 14px 30px rgba(185, 28, 28, 0.2);
}

.service-alert-banner strong {
  color: #ffffff;
}

.service-alert-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.service-alert-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff5f5;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.service-ticket-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.service-ticket-item.is-alert {
  border: 1.5px solid rgba(239, 68, 68, 0.28);
  background: linear-gradient(180deg, #fff8f8, #ffffff);
}

.service-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 12px;
}

.service-dashboard-card {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 10px 22px rgba(148, 163, 184, 0.10);
}

.service-dashboard-card.is-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.service-dashboard-card.is-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.28);
}

.service-dashboard-label {
  display: block;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.service-dashboard-value {
  font-size: 28px;
  line-height: 1.1;
  color: #0f172a;
}

.service-dashboard-card.is-reported {
  background: linear-gradient(180deg, #fff7ed, #ffffff);
}

.service-dashboard-card.is-dispatched {
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.service-dashboard-card.is-confirmed {
  background: linear-gradient(180deg, #f5f3ff, #ffffff);
}

.service-dashboard-card.is-today {
  background: linear-gradient(180deg, #ecfeff, #ffffff);
}

.service-dashboard-card.is-completed {
  background: linear-gradient(180deg, #ecfdf5, #ffffff);
}

.service-dashboard-card.is-satisfaction {
  background: linear-gradient(180deg, #fefce8, #ffffff);
}

.admin-module-switcher {
  margin-bottom: 16px;
}

.admin-module-switcher-head h3 {
  margin: 0 0 6px;
}

.admin-module-switcher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-module-btn {
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  color: #1e3a8a;
  font-weight: 700;
}

.admin-module-btn.is-active {
  border-color: #2563eb;
  background: linear-gradient(180deg, #dbeafe, #eff6ff);
  color: #1d4ed8;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.14);
}

.admin-mode-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(180deg, #eff6ff, #ffffff);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.service-dashboard-meta {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
}

.service-duplicate-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.service-form-hint {
  margin: 0 0 14px;
  line-height: 1.6;
}

.service-duplicate-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: linear-gradient(180deg, #fffbeb, #ffffff);
  color: #92400e;
  line-height: 1.65;
}

.service-duplicate-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.service-duplicate-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.service-duplicate-list li + li {
  margin-top: 4px;
}

.service-close-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: linear-gradient(180deg, #ecfdf5, #ffffff);
}

.service-close-summary h4 {
  margin: 0 0 8px;
  color: #065f46;
}

.service-form-compact .actions button {
  min-height: 46px;
}

.service-detail-basic {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: #fafcff;
}

.customer-list-card {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.10);
}

.customer-list-card.is-followup {
  border-color: #fed7aa;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.95), #ffffff);
}

.customer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-card-title-wrap {
  min-width: 0;
  flex: 1;
}

.customer-list-card h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
  color: #0f172a;
}

.customer-list-card h3 small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.customer-card-line {
  margin: 0 0 6px;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}

.customer-card-line.meta {
  color: #64748b;
}

.customer-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.customer-level-badge.is-a-plus {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.20);
}

.customer-level-badge.is-b-plus {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border-color: rgba(129, 140, 248, 0.20);
}

.customer-level-badge.is-c-plus {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.22);
}

.customer-level-badge.is-deal {
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  border-color: rgba(251, 146, 60, 0.24);
}

.customer-level-badge.is-default {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(148, 163, 184, 0.22);
}

.customer-card-summary-inline {
  margin: 8px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.customer-card-actions {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .grid.two,
  .grid.three,
  .grid.four,
  .service-dashboard-grid,
  .home-summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .actions,
  .inline-head,
  .topbar-actions,
  .home-summary-head {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-user-meta {
    align-items: stretch;
  }

  .sales-compact-summary {
    justify-content: flex-start;
    gap: 8px 12px;
  }

  body.auth-screen::before {
    background: linear-gradient(180deg, #f4f2ef, #f8f6f2);
  }

  body.auth-screen::after {
    background: linear-gradient(180deg, rgba(250, 248, 244, 0.20) 0%, rgba(250, 248, 244, 0.10) 100%);
  }

  .topbar::before {
    background-size: 150% auto;
    background-position: 78% center;
  }

  .topbar::after {
    background: linear-gradient(180deg, rgba(252, 249, 245, 0.82) 0%, rgba(252, 249, 245, 0.62) 40%, rgba(252, 249, 245, 0.30) 100%);
  }

  body.auth-screen .topbar {
    margin-top: 0;
  }

  .auth-card {
    padding: 22px 18px 18px;
  }


  .auth-card h2 {
    font-size: 24px;
  }

  .auth-lead {
    margin: 6px 0 16px;
    font-size: 13px;
    line-height: 1.6;
  }

  .auth-card .actions {
    gap: 10px;
  }

  .auth-meta-line {
    margin-top: 12px;
    padding-top: 10px;
  }

  .home-summary-store {
    justify-content: center;
  }

  .home-summary-card {
    padding: 14px 14px 12px;
  }

  .home-summary-head {
    gap: 8px;
    margin-bottom: 12px;
  }

  .home-summary-kicker {
    min-height: 24px;
    padding: 0 9px;
    margin-bottom: 7px;
    font-size: 10px;
  }

  .home-summary-value {
    font-size: 34px;
  }

  .home-summary-item {
    padding: 11px 12px 10px;
  }

  .home-summary-item-value {
    font-size: 20px;
  }

  .home-action-card {
    min-height: 128px;
  }

  .home-secondary-entry {
    margin-top: 10px;
  }

  .home-reminder-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-reminder-item-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-action-card-wide {
    min-height: 108px;
  }

  .analytics-source-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .analytics-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .analytics-metric-card {
    padding: 10px 12px;
  }

  .analytics-metric-value {
    font-size: 18px;
  }

  .analytics-total-chip {
    padding: 10px 12px;
  }

  .analytics-total-chip-value {
    font-size: 20px;
  }

  .analytics-table th,
  .analytics-table td {
    padding: 10px;
    font-size: 12px;
  }

  .analytics-chart-card {
    padding: 12px;
  }

  .analytics-chart-head,
  .analytics-source-bar-head {
    flex-direction: column;
    align-items: stretch;
  }

  .analytics-column-chart {
    gap: 8px;
    grid-auto-columns: minmax(38px, 1fr);
  }

  .analytics-column-bars {
    min-height: 136px;
    gap: 6px;
  }

  .analytics-column {
    width: 11px;
  }

  #myCustomersView {
    padding: 14px;
  }

  #myCustomersView .inline-head {
    gap: 8px;
  }

  #myCustomersView .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #myCustomersView .top-actions button,
  #myCustomersView .top-actions .nav-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }


  #myCustomersView .my-customer-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #myCustomersView .my-customer-filters .filter-keyword {
    grid-column: 1 / -1;
  }

  #myCustomersView .my-customer-filters input,
  #myCustomersView .my-customer-filters select {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #myCustomersView .search-summary {
    padding: 7px 9px;
    font-size: 12px;
  }

  #followupView {
    padding: 14px;
  }

  #followupView .inline-head {
    gap: 8px;
  }

  #followupView .followup-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #followupView .followup-top-actions button,
  #followupView .followup-top-actions .nav-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #adminView .admin-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #adminView .admin-top-actions button,
  #adminView .admin-top-actions .nav-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #adminView .admin-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #adminView .admin-filters .filter-keyword {
    grid-column: 1 / -1;
  }

  #adminView .admin-filters input,
  #adminView .admin-filters select {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #adminView .admin-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #adminView .admin-filter-actions button {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #adminView .search-summary {
    padding: 7px 9px;
    font-size: 12px;
  }

  #followupView .followup-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #followupView .followup-filters select {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #followupView .search-summary {
    padding: 7px 9px;
    font-size: 12px;
  }

  .analytics-custom-range {
    padding: 9px 10px;
  }

  .analytics-custom-range-fields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .analytics-custom-range-fields input {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .analytics-store-tabs {
    gap: 6px;
  }

  .analytics-store-tab {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 12px;
  }

  #customerDetailView {
    padding: 14px;
  }

  #customerDetailView .inline-head {
    gap: 8px;
  }

  #customerDetailView .panel-block {
    padding: 12px;
    margin-top: 12px;
  }

  #customerDetailView .panel-block h3 {
    margin-bottom: 10px;
    font-size: 17px;
  }

  #customerDetailView .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #customerDetailView .detail-actions button,
  #customerDetailView .detail-actions .button-link {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  #customerDetailView textarea,
  #customerDetailView input,
  #customerDetailView select {
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }

  .customer-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-card-meta-grid {
    grid-template-columns: 1fr;
  }
}


.row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #e5e7eb;
  color: #374151;
  text-decoration: none;
}


.nav-btn {
  color: #ffffff;
  background: #6b7280;
}

#adminEntryBtn:not(.home-action-card) {
  color: #ffffff;
  background: #6b7280;
}

#adminView,
#adminView h2,
#adminView h3,
#adminView label,
#adminView p,
#adminView span,
#adminView small {
  color: #1f2a37;
}

#adminView input,
#adminView textarea,
#adminView select,
#adminView option {
  color: #1f2a37;
  -webkit-text-fill-color: #1f2a37;
  background: #ffffff;
}

#adminView .list-item,
#adminView .list-item h3,
#adminView .list-item p,
#adminView .panel-block,
#adminView .panel-block h3 {
  color: #1f2a37;
}

#adminView button {
  color: #ffffff;
}

#adminView button.ghost {
  color: #374151;
}

#analyticsView .panel-block,
#analyticsView .panel-block h3,
#analyticsView .list-item,
#analyticsView .list-item p {
  color: #4b3b2a;
}

.analytics-panel-block {
  background: linear-gradient(135deg, rgba(251, 248, 243, 0.94) 0%, rgba(246, 240, 230, 0.88) 100%);
  border-color: rgba(186, 163, 135, 0.20);
  box-shadow: 0 14px 30px rgba(120, 104, 78, 0.08);
}

.analytics-filters {
  gap: 10px 12px;
}


.analytics-store-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.analytics-custom-range {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(186, 163, 135, 0.18);
}

.analytics-custom-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.analytics-custom-range-fields label {
  gap: 5px;
  font-size: 12px;
  color: #7b6d5a;
}

.analytics-custom-range-fields input {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(186, 163, 135, 0.24);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.analytics-filter-label {
  color: #8a7c69;
  font-size: 13px;
}

.analytics-store-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analytics-store-tab {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(186, 163, 135, 0.28);
  background: rgba(255, 255, 255, 0.74);
  color: #6b5d4b;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.analytics-store-tab:hover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(162, 135, 104, 0.4);
}

.analytics-store-tab.is-active {
  background: linear-gradient(135deg, #7c5f3b 0%, #9d7b4e 100%);
  border-color: rgba(124, 95, 59, 0.92);
  color: #fff8ef;
  box-shadow: 0 8px 18px rgba(124, 95, 59, 0.18);
}

.analytics-source-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-metric-card {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(186, 163, 135, 0.18);
  box-shadow: 0 8px 18px rgba(120, 104, 78, 0.06);
}

.analytics-metric-label {
  display: block;
  color: #8a7c69;
  font-size: 12px;
  margin-bottom: 6px;
}

.analytics-metric-value {
  font-size: 22px;
  line-height: 1.2;
  color: #4b3b2a;
}

.analytics-total-chip {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(186, 163, 135, 0.18);
  box-shadow: 0 8px 18px rgba(120, 104, 78, 0.06);
}

.analytics-total-chip-label {
  display: block;
  color: #8a7c69;
  font-size: 12px;
  margin-bottom: 6px;
}

.analytics-total-chip-value {
  font-size: 24px;
  line-height: 1;
  color: #4b3b2a;
}

.analytics-table-wrap {
  margin-top: 14px;
}

.analytics-chart-panel {
  margin-top: 14px;
}

.analytics-chart-card {
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(186, 163, 135, 0.18);
  box-shadow: 0 8px 18px rgba(120, 104, 78, 0.06);
}

.analytics-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.analytics-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: #6b5d4b;
}

.analytics-chart-subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: #9a8b76;
}

.analytics-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8a7c69;
  font-size: 12px;
}

.analytics-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.analytics-legend-dot.is-reception,
.analytics-column-reception {
  background: #b08968;
}

.analytics-legend-dot.is-lead,
.analytics-column-lead {
  background: #6b8fb0;
}

.analytics-legend-dot.is-a-plus,
.analytics-column-a-plus {
  background: #7d9f7b;
}

.analytics-legend-dot.is-deposit,
.analytics-column-deposit {
  background: #c6975f;
}

.analytics-legend-dot.is-sign,
.analytics-column-sign {
  background: #9c6f55;
}

.analytics-source-bar-list {
  display: grid;
  gap: 10px;
}

.analytics-source-bar-item {
  display: grid;
  gap: 6px;
}

.analytics-source-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.analytics-source-bar-label,
.analytics-source-bar-meta {
  font-size: 12px;
  color: #6b5d4b;
}

.analytics-source-bar-meta {
  color: #8a7c69;
}

.analytics-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(186, 163, 135, 0.14);
  overflow: hidden;
}

.analytics-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c8a98a 0%, #9c6f55 100%);
}

.analytics-column-chart {
  min-height: 220px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(44px, 1fr);
  gap: 10px;
  align-items: end;
  overflow-x: auto;
  padding-top: 6px;
}

.analytics-column-chart-rates {
  min-height: 210px;
}

.analytics-column-group {
  display: grid;
  gap: 8px;
  align-items: end;
}

.analytics-column-bars {
  min-height: 160px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
}

.analytics-column-bars-triple {
  gap: 6px;
}

.analytics-column-chart-traffic {
  min-height: 240px;
}

.analytics-column-group-traffic {
  gap: 10px;
}

.analytics-column-bars-traffic {
  min-height: 190px;
  gap: 10px;
}

.analytics-column-series {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.analytics-column-value {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 10px rgba(120, 104, 78, 0.08);
}

.analytics-column-value-reception {
  color: #8b5e34;
}

.analytics-column-value-lead {
  color: #466b8f;
}

.analytics-column {
  width: 14px;
  min-height: 2px;
  border-radius: 999px 999px 4px 4px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.24);
}

.analytics-column-label {
  color: #8a7c69;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.analytics-empty-chart {
  color: #8a7c69;
}

.analytics-table-inner {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid rgba(186, 163, 135, 0.18);
  background: rgba(255, 255, 255, 0.76);
}

.analytics-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table.analytics-table-compact {
  min-width: 640px;
}

.analytics-table th,
.analytics-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(186, 163, 135, 0.14);
  text-align: center;
  white-space: nowrap;
}

.analytics-table thead th {
  background: rgba(123, 92, 58, 0.08);
  color: #6b5d4b;
  font-weight: 700;
}

.analytics-table tbody th {
  color: #5a4b39;
  font-weight: 700;
  background: rgba(252, 249, 245, 0.72);
}

.analytics-table tbody tr:last-child th,
.analytics-table tbody tr:last-child td {
  border-bottom: none;
}

#analyticsView .search-summary {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(186, 163, 135, 0.16);
  color: #5a4b39;
}


.brand-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 28px;
  line-height: 1.2;
  word-break: break-word;
}

.brand-sub {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}

.topbar {
  gap: 12px;
}

.topbar > div:first-child {
  min-width: 0;
}

.card h2,
.panel-block h3,
.list-item h3 {
  line-height: 1.35;
  word-break: break-word;
}

label,
p,
span,
small,
button,
a,
textarea,
input,
select {
  word-break: break-word;
}

.nav-btn {
  min-height: 92px;
  font-size: 16px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  text-align: center;
}

.actions button,
.row-actions button,
.button-link {
  white-space: normal;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .brand-title {
    font-size: 22px;
  }

  .brand-sub {
    font-size: 12px;
  }

  .nav-btn {
    font-size: 15px;
    min-height: 84px;
  }
}


#changePasswordView {
  max-width: 720px;
}


#registerView {
  max-width: 720px;
}


.pending-item {
  background: #f8fafc;
  border-color: #d1d5db;
}


.inline-actions {
  justify-content: flex-start;
  align-items: end;
}


.top-actions {
  margin-top: 0;
}

.top-actions button {
  min-height: 44px;
  font-size: 14px;
}

.top-actions .nav-btn {
  min-height: 44px;
  font-size: 14px;
}

.unified-top-actions {
  gap: 8px;
}

.unified-top-btn {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #dbe2f0;
  color: #374151;
  box-shadow: none;
}

.unified-top-btn:hover {
  background: #eef2f7;
}
.unified-top-btn.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.unified-top-btn.danger:hover {
  background: #fecaca;
}

.service-ticket-delete-btn {
  min-height: 44px;
  padding: 10px 14px;
}


.search-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.list-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5b6472;
  font-size: 13px;
}

.list-page-size select {
  width: auto;
  min-width: 90px;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.list-pagination-info {
  color: #5b6472;
  font-size: 13px;
}

.list-pagination button {
  min-width: 76px;
}


.search-summary.empty {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 600;
}


.more-menu {
  position: relative;
  z-index: 30;
}

.more-trigger {
  list-style: none;
  min-width: 72px;
  text-align: center;
  padding: 10px 14px;
}

.more-trigger::-webkit-details-marker {
  display: none;
}

.more-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 120px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  z-index: 60;
}

.more-item {
  width: 100%;
  text-align: left;
}


.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.modal-panel {
  width: min(100%, 420px);
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.2);
}

.modal-panel .actions {
  justify-content: flex-end;
}

.unsaved-changes-text {
  margin: 10px 0 0;
  line-height: 1.6;
}

.delete-confirm-panel {
  width: min(100%, 360px);
  border: 1px solid #fecaca;
  background: linear-gradient(180deg, #fff7f7, #ffffff);
  padding: 16px;
}

.delete-confirm-panel h3 {
  margin: 0;
  font-size: 18px;
}

.delete-confirm-text {
  margin: 8px 0 0;
  line-height: 1.65;
  color: #7f1d1d;
  font-size: 14px;
}

#confirmDeleteCustomerBtn {
  background: #dc2626;
  color: #ffffff;
}

#confirmDeleteCustomerBtn:hover {
  background: #b91c1c;
}

@media (max-width: 640px) {
  .modal-panel .actions {
    align-items: stretch;
  }

  .delete-confirm-panel {
    width: min(100%, 320px);
    padding: 14px;
    border-radius: 16px;
  }

  .delete-confirm-panel .inline-head {
    gap: 8px;
  }

  .delete-confirm-panel .actions {
    gap: 10px;
  }

  .delete-confirm-panel button {
    min-height: 44px;
  }
}


.service-threshold-panel {
  margin-top: 12px;
  border: 1px solid rgba(191, 219, 254, 0.8);
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.service-threshold-panel h4 {
  margin: 0 0 4px;
  color: #1d4ed8;
}




.operation-log-time {
  font-weight: 700;
  color: #0f172a;
}


@media (max-width: 1024px) {
  .admin-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-home-grid {
    grid-template-columns: 1fr;
  }

  .admin-entry-card {
    padding: 16px;
    border-radius: 16px;
  }

  .admin-entry-title {
    font-size: 18px;
  }

  #adminView .admin-top-actions,
  #adminDashboardView .admin-top-actions,
  #userManagementView .admin-top-actions,
  #operationLogsView .admin-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #adminView .admin-top-actions button,
  #adminView .admin-top-actions .nav-btn,
  #adminDashboardView .admin-top-actions button,
  #adminDashboardView .admin-top-actions .nav-btn,
  #userManagementView .admin-top-actions button,
  #userManagementView .admin-top-actions .nav-btn,
  #operationLogsView .admin-top-actions button,
  #operationLogsView .admin-top-actions .nav-btn {
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    font-size: 13px;
  }
}


.operation-log-item {
  display: grid;
  gap: 8px;
}

.operation-log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.operation-log-head h3 {
  margin: 0;
}

.operation-log-module {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.operation-log-module-sales {
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
}

.operation-log-module-aftersales {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}

.operation-log-module-account {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.operation-log-module-system {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}


.operation-log-ua {
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
}
