:root {
  --bg: #f4fbfd;
  --surface: #ffffff;
  --surface-2: #f5fbfd;
  --text: #10222d;
  --muted: #4b6470;
  --border: #d9edf4;
  --primary: #00bcd4;
  --primary-dark: #057f91;
  --primary-glow: #00e5ff;
  --success: #1f9d55;
  --danger: #d64545;
  --warning: #f59e0b;
  --shadow: 0 18px 46px rgba(8, 47, 63, 0.10);
  --shadow-soft: 0 10px 26px rgba(8, 47, 63, 0.07);
  --radius: 20px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 78% 0%, rgba(0, 188, 212, 0.14), transparent 30%),
    radial-gradient(circle at 8% 18%, rgba(0, 229, 255, 0.10), transparent 30%),
    linear-gradient(180deg, #f6fdff 0%, #edf9fc 48%, #ffffff 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 32px auto;
}

h1 {
  margin: 0 0 20px;
  font-size: 2rem;
  font-weight: 800;
  color: #10222d;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #10222d;
}

p {
  line-height: 1.5;
  color: var(--muted);
}

section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 251, 253, 0.96) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #10222d;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s ease;
}

input:focus,
select:focus,
textarea:focus,
td[contenteditable="true"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.12);
}

button {
  appearance: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-glow), var(--primary));
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(0, 188, 212, 0.22);
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  background: linear-gradient(135deg, #17d8ea, var(--primary-dark));
  box-shadow: 0 18px 36px rgba(0, 188, 212, 0.26);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

thead {
  background: #eafbff;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 0.9rem;
  color: #10222d;
  font-weight: 800;
}

td {
  font-size: 0.94rem;
}

tbody tr:hover {
  background: #f5fcfe;
}

td[contenteditable="true"] {
  border-radius: 8px;
  background: transparent;
  transition: 0.2s ease;
}

.msg {
  min-height: 20px;
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.msg.success {
  color: var(--success);
}

.msg.error {
  color: var(--danger);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  background: #ecfeff;
  color: #3f5965;
  border: 1px solid #bfeef3;
}

.badge.blocked {
  background: #fff1f1;
  color: #a33131;
  border-color: #f4c7c7;
}

.badge.active {
  background: #edfdf3;
  color: #157347;
  border-color: #c7efd6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions button,
.actions .action-link {
  padding: 9px 12px;
  font-size: 0.88rem;
}

.actions .secondary,
.actions .action-link.secondary {
  background: #f3fbfd;
  color: #10222d;
  border: 1px solid var(--border);
  box-shadow: none;
}

.actions .secondary:hover,
.actions .action-link.secondary:hover {
  background: #e6f8fb;
}

.actions .action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.actions .danger {
  background: #ffeaea;
  color: #b42318;
  border: 1px solid #f6c7c7;
}

.actions .danger:hover {
  background: #ffdede;
}

.actions .success {
  background: #eafaf0;
  color: #157347;
  border: 1px solid #c7efd6;
}

.actions .success:hover {
  background: #def6e8;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(8, 47, 63, 0.18);
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin-bottom: 6px;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
}

.modal-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: #f3fbfd;
  color: #10222d;
  border: 1px solid var(--border);
}

.modal-close:hover {
  background: #e1f1f7;
}

.modal-form {
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.secondary-btn {
  background: #f3fbfd;
  color: #10222d;
  border: 1px solid var(--border);
  box-shadow: none;
}

.secondary-btn:hover {
  background: #e1f1f7;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5fbfd 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.stat-card .value {
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  color: #10222d;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 1100px);
    margin: 20px auto;
  }

  section {
    padding: 16px;
    border-radius: 16px;
  }

  th, td {
    padding: 12px 10px;
    font-size: 0.88rem;
  }

  h1 {
    font-size: 1.6rem;
  }
}
.login-page {
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.85fr);
  gap: 40px;
}

.login-brand h1 {
  font-size: 3.55rem;
  line-height: 1.03;
  max-width: 560px;
}

.login-brand {
  gap: 22px;
}

.flow-panel {
  min-height: 150px;
  max-width: 620px;
}

.brand-points {
  display: none;
}

.login-card {
  padding: 40px 38px;
  border-radius: 14px;
}

.login-card h2 {
  font-size: 2.15rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  min-height: 56px;
  background: #ffffff;
}

.login-submit {
  min-height: 56px;
  border-radius: 10px;
}

/* SenTicket console polish: admin, agent and display surfaces */
:root {
  --st-aqua: #00d5e8;
  --st-teal: #008c95;
  --st-deep: #06242d;
  --st-text: #123244;
  --st-muted: #647887;
  --st-border: rgba(0, 160, 170, 0.16);
  --st-glow: 0 18px 45px rgba(0, 213, 232, 0.22);
  --st-glow-soft: 0 12px 28px rgba(0, 150, 160, 0.14);
  --st-radius: 18px;
  --st-speed: 180ms;
}

.btn-primary,
button.btn-primary,
.primary-action,
.save-button,
.upgrade-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--st-aqua), var(--st-teal));
  border-color: rgba(0, 140, 149, 0.72);
  box-shadow: var(--st-glow-soft);
}

.btn-secondary,
button.btn-secondary,
.secondary-btn,
.btn-ghost,
.ghost,
.upgrade-ghost,
.action-link.secondary {
  color: #0f566b;
  background: #eefafb;
  border: 1px solid rgba(0, 160, 170, 0.18);
  box-shadow: none;
}

button,
.btn-primary,
.btn-secondary,
.btn-ghost,
.secondary-btn,
.ghost,
.action-link,
.save-button,
.upgrade-primary,
.upgrade-ghost {
  transition:
    transform var(--st-speed) ease,
    box-shadow var(--st-speed) ease,
    border-color var(--st-speed) ease,
    background var(--st-speed) ease,
    opacity var(--st-speed) ease;
}

button:hover:not(:disabled),
.btn-primary:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.secondary-btn:hover,
.ghost:hover,
.action-link:hover,
.save-button:hover:not(:disabled),
.upgrade-primary:hover,
.upgrade-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 160, 170, 0.34);
  box-shadow: var(--st-glow-soft);
}

button:disabled,
button:disabled:hover,
.btn-disabled,
.btn-disabled:hover,
[aria-disabled="true"],
[aria-disabled="true"]:hover {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

button:active,
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active,
.secondary-btn:active,
.ghost:active,
.action-link:active,
.save-button:active {
  transform: translateY(0);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(0, 213, 232, 0.32);
  outline-offset: 3px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 160, 170, 0.42);
  box-shadow: 0 0 0 4px rgba(0, 213, 232, 0.12);
}

section,
.stat-card,
.kpi-card,
.service-card,
.module-card,
.create-service-card,
.schedule-card,
.appointments-card,
.preview-card,
.profile-form,
.filters-card,
.state-card,
.list-card,
.ticket-hero,
.actions-card,
.side-card,
.next-ticket-card,
.create-ticket-card,
.ticket-table-card,
.display-panel,
.display-side,
.qr-card {
  transition:
    transform var(--st-speed) ease,
    border-color var(--st-speed) ease,
    box-shadow var(--st-speed) ease,
    background var(--st-speed) ease;
}

.container > section,
.appointments-shell > section,
.agent-shell section {
  padding-block: 18px;
}

.container > section:hover,
.stat-card:hover,
.kpi-card:hover,
.service-card:hover,
.module-card:hover,
.create-service-card:hover,
.schedule-card:hover,
.appointments-card:hover,
.preview-card:hover,
.filters-card:hover,
.state-card:hover,
.list-card:hover,
.ticket-table-card:hover,
.side-card:hover,
.next-ticket-card:hover,
.create-ticket-card:hover {
  border-color: rgba(0, 160, 170, 0.24);
  box-shadow: var(--st-glow-soft);
}

.badge,
.subscription-pill,
.subscription-badge,
.plan-pill,
.module-badge,
.module-card-badge,
.source-badge {
  border-radius: 999px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.subscription-pill.active,
.subscription-badge.active,
.badge.active {
  color: #0f766e;
  background: #ecfdf5;
  border-color: #99f6e4;
}

.subscription-pill.trial,
.subscription-badge.trial {
  color: #0369a1;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.subscription-pill.suspended,
.subscription-pill.expired,
.subscription-pill.cancelled,
.subscription-badge.suspended,
.subscription-badge.expired,
.badge.blocked {
  color: #92400e;
  background: #fff7ed;
  border-color: #fed7aa;
}

.empty-state,
.confirm-empty,
.access-denied-panel {
  border-radius: var(--st-radius);
  box-shadow: var(--st-glow-soft);
}

.confirm-empty,
.empty-state {
  border: 1px dashed rgba(0, 160, 170, 0.24);
  background: rgba(247, 253, 255, 0.9);
  color: var(--st-muted);
}

.agent-shell #btnNext,
.agent-shell .primary-action {
  min-height: 64px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 950;
  border-radius: 18px;
  box-shadow: var(--st-glow);
}

.agent-shell .ticket-hero {
  min-height: 240px;
}

.agent-shell .ticket-number,
.agent-shell #currentTicket,
.agent-shell .next-ticket-display strong {
  min-height: 0.95em;
  letter-spacing: 0;
}

.agent-shell .actions-bar {
  align-items: stretch;
}

.agent-shell .msg {
  min-height: 1.25em;
}

.display-panel {
  border-color: rgba(0, 160, 170, 0.2);
}

@media (max-width: 768px) {
  .container > section,
  .appointments-shell > section,
  .agent-shell section {
    padding-block: 16px;
  }

  .agent-shell #btnNext,
  .agent-shell .primary-action {
    min-height: 58px;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  button:hover,
  a:hover,
  section:hover,
  .stat-card:hover,
  .kpi-card:hover,
  .service-card:hover,
  .module-card:hover,
  .create-service-card:hover,
  .schedule-card:hover,
  .appointments-card:hover,
  .preview-card:hover,
  .filters-card:hover,
  .state-card:hover,
  .list-card:hover,
  .ticket-table-card:hover,
  .side-card:hover,
  .next-ticket-card:hover,
  .create-ticket-card:hover {
    transform: none !important;
  }
}
