/* ============================================================
   Vocaly Dashboard - app.css
   Design tokens, reset, layout, and all component styles
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
  --navy: #0a0e27;
  --deep: #111640;
  --amber: #f5a623;
  --amber-light: #ffd580;
  --amber-dim: rgba(245, 166, 35, 0.12);
  --slate: #8892b0;
  --light: #ccd6f6;
  --white: #e6f1ff;
  --border: rgba(136, 146, 176, 0.15);
  --border-hover: rgba(136, 146, 176, 0.3);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}


/* ----------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--navy);
  color: var(--light);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

a {
  color: var(--amber);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--amber-light);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: 0.925rem;
}

::selection {
  background: var(--amber);
  color: var(--navy);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(136, 146, 176, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(136, 146, 176, 0.4);
}


/* ----------------------------------------------------------
   3. LAYOUT
   ---------------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: calc(var(--topbar-height) + 24px) 32px 32px;
}

.page-content {
  max-width: 1280px;
  margin: 0 auto;
}


/* ----------------------------------------------------------
   4. SIDEBAR
   ---------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--deep) 0%, var(--navy) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-base);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  padding: 16px 12px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate);
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.sidebar-link:hover {
  color: var(--light);
  background: rgba(136, 146, 176, 0.08);
}

.sidebar-link.active {
  color: var(--amber);
  background: var(--amber-dim);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--amber);
  border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-link-badge {
  margin-left: auto;
  background: var(--amber);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--amber-dim), var(--deep));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--slate);
}


/* ----------------------------------------------------------
   5. TOP BAR
   ---------------------------------------------------------- */
.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 90;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
}

.top-bar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--slate);
}

.top-bar-breadcrumb-sep {
  color: var(--border-hover);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  transition: all var(--transition-fast);
  position: relative;
  font-size: 1.1rem;
}

.top-bar-icon-btn:hover {
  color: var(--white);
  background: rgba(136, 146, 176, 0.1);
}

.top-bar-icon-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--navy);
}

.top-bar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.top-bar-user:hover {
  background: rgba(136, 146, 176, 0.08);
}

.top-bar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}

.top-bar-user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--light);
}


/* ----------------------------------------------------------
   6. CARDS
   ---------------------------------------------------------- */
.card {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.card-header h3,
.card-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}


/* ----------------------------------------------------------
   7. STAT CARDS & STATS GRID
   ---------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--amber-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--amber);
}

.stat-card-trend {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-card-trend.up {
  color: var(--green);
  background: var(--green-dim);
}

.stat-card-trend.down {
  color: var(--red);
  background: var(--red-dim);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--slate);
  font-weight: 500;
}


/* ----------------------------------------------------------
   8. TABLES
   ---------------------------------------------------------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: rgba(136, 146, 176, 0.06);
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--light);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(136, 146, 176, 0.04);
}

td .cell-primary {
  font-weight: 500;
  color: var(--white);
}

td .cell-secondary {
  font-size: 0.8rem;
  color: var(--slate);
  margin-top: 2px;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.table-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.table-action-btn:hover {
  color: var(--white);
  background: rgba(136, 146, 176, 0.1);
}

.table-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--slate);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--slate);
}


/* ----------------------------------------------------------
   9. FORMS
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--light);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 5px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--light);
  padding: 10px 14px;
  font-size: 0.925rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(136, 146, 176, 0.5);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-dim);
}

.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim);
}

.form-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 5px;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892b0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--light);
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--amber);
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}


/* ----------------------------------------------------------
   10. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: var(--navy);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--light);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--slate);
  background: rgba(136, 146, 176, 0.08);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
  background: #ef4444;
  box-shadow: 0 4px 16px rgba(248, 113, 113, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--slate);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--light);
  background: rgba(136, 146, 176, 0.08);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

.btn-primary.btn-loading::after {
  border-color: rgba(10, 14, 39, 0.3);
  border-top-color: var(--navy);
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}


/* ----------------------------------------------------------
   11. CALENDAR
   ---------------------------------------------------------- */
.calendar {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.cal-header-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
}

.cal-header-nav {
  display: flex;
  gap: 6px;
}

.cal-header-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}

.cal-header-btn:hover {
  color: var(--white);
  background: rgba(136, 146, 176, 0.1);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.cal-weekday {
  text-align: center;
  padding: 10px 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px;
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--light);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  gap: 4px;
}

.cal-day:hover {
  background: rgba(136, 146, 176, 0.08);
}

.cal-day.other-month {
  color: rgba(136, 146, 176, 0.3);
}

.cal-day.today {
  background: var(--amber-dim);
  color: var(--amber);
  font-weight: 700;
}

.cal-day.today:hover {
  background: rgba(245, 166, 35, 0.2);
}

.cal-day.selected {
  background: var(--amber);
  color: var(--navy);
  font-weight: 700;
}

.cal-day.has-appointment {
  font-weight: 600;
}

.cal-dots {
  display: flex;
  gap: 3px;
  position: absolute;
  bottom: 4px;
}

.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.cal-dot.confirmed {
  background: var(--green);
}

.cal-dot.cancelled {
  background: var(--red);
}


/* ----------------------------------------------------------
   12. CHAT INTERFACE
   ---------------------------------------------------------- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 480px;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}

.chat-header-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
}

.chat-header-status {
  font-size: 0.78rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  animation: chatFadeIn 0.25s ease;
}

@keyframes chatFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.vocaly {
  align-self: flex-start;
  background: rgba(136, 146, 176, 0.1);
  color: var(--light);
  border-bottom-left-radius: 4px;
}

.chat-message.caller {
  align-self: flex-end;
  background: var(--amber-dim);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-message-time {
  font-size: 0.7rem;
  color: var(--slate);
  margin-top: 6px;
  display: block;
}

.chat-message.vocaly .chat-message-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 4px;
}

.chat-message.caller .chat-message-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 4px;
  text-align: right;
}

.typing-indicator {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(136, 146, 176, 0.1);
  border-radius: var(--radius-md);
  border-bottom-left-radius: 4px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--slate);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 39, 0.4);
}

.chat-input-area input {
  flex: 1;
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--light);
  padding: 10px 18px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-area input::placeholder {
  color: rgba(136, 146, 176, 0.5);
}

.chat-input-area input:focus {
  border-color: var(--amber);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
  transform: scale(1.05);
}


/* ----------------------------------------------------------
   13. BADGES & TAGS
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.5;
}

.badge-appointment {
  background: var(--green-dim);
  color: var(--green);
}

.badge-faq {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge-urgent {
  background: var(--red-dim);
  color: var(--red);
}

.badge-general {
  background: rgba(136, 146, 176, 0.12);
  color: var(--slate);
}

.badge-confirmed {
  background: var(--green-dim);
  color: var(--green);
}

.badge-cancelled {
  background: var(--red-dim);
  color: var(--red);
}

.badge-pending {
  background: var(--amber-dim);
  color: var(--amber);
}

.badge-missed {
  background: rgba(136, 146, 176, 0.12);
  color: var(--slate);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}


/* ----------------------------------------------------------
   14. MODAL
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: modalOverlayIn 0.2s ease;
}

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--white);
  background: rgba(136, 146, 176, 0.1);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.modal-lg {
  max-width: 680px;
}


/* ----------------------------------------------------------
   15. SETUP WIZARD
   ---------------------------------------------------------- */
.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
  padding: 0 20px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.wizard-step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate);
  background: var(--navy);
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.wizard-step-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--slate);
  white-space: nowrap;
  transition: color var(--transition-base);
}

.wizard-step-connector {
  width: 48px;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  transition: background var(--transition-base);
  flex-shrink: 0;
}

.wizard-step.active .wizard-step-number {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-dim);
}

.wizard-step.active .wizard-step-label {
  color: var(--amber);
}

.wizard-step.completed .wizard-step-number {
  border-color: var(--green);
  background: var(--green);
  color: var(--navy);
}

.wizard-step.completed .wizard-step-label {
  color: var(--green);
}

.wizard-step.completed + .wizard-step-connector {
  background: var(--green);
}

.wizard-content {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
}


/* ----------------------------------------------------------
   16. AUTH PAGES
   ---------------------------------------------------------- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--navy);
  position: relative;
}

.auth-container::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-container::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--navy);
}

.auth-logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.auth-title {
  text-align: center;
  font-size: 1.2rem;
  color: var(--white);
  margin-top: 24px;
  margin-bottom: 4px;
}

.auth-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--slate);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  font-size: 0.8rem;
  color: var(--slate);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ----------------------------------------------------------
   17. TOAST NOTIFICATIONS
   ---------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.35s ease;
}

.toast.toast-exit {
  animation: toastSlideOut 0.25s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon {
  background: var(--green-dim);
  color: var(--green);
}

.toast-error .toast-icon {
  background: var(--red-dim);
  color: var(--red);
}

.toast-warning .toast-icon {
  background: var(--amber-dim);
  color: var(--amber);
}

.toast-info .toast-icon {
  background: var(--blue-dim);
  color: var(--blue);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.4;
}

.toast-close {
  color: var(--slate);
  font-size: 1rem;
  padding: 2px;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--white);
}


/* ----------------------------------------------------------
   18. EMPTY STATES
   ---------------------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: rgba(136, 146, 176, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--slate);
  margin-bottom: 16px;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--slate);
  max-width: 360px;
  line-height: 1.5;
  margin-bottom: 20px;
}


/* ----------------------------------------------------------
   19. MOBILE HEADER
   ---------------------------------------------------------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 110;
}

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light);
  font-size: 1.3rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: rgba(136, 146, 176, 0.1);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
}

.mobile-logo-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}


/* ----------------------------------------------------------
   20. UTILITY CLASSES
   ---------------------------------------------------------- */
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-slate { color: var(--slate); }
.text-white { color: var(--white); }
.text-light { color: var(--light); }

.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1.15rem; }

.font-heading { font-family: var(--font-heading); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--amber-dim), var(--deep));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber);
  flex-shrink: 0;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(136, 146, 176, 0.06) 0%,
    rgba(136, 146, 176, 0.12) 50%,
    rgba(136, 146, 176, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ----------------------------------------------------------
   21. RESPONSIVE - TABLET (max-width: 1024px)
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .wizard-steps {
    gap: 0;
  }

  .wizard-step-label {
    display: none;
  }

  .wizard-step-connector {
    width: 32px;
    margin: 0 6px;
  }
}


/* ----------------------------------------------------------
   22. RESPONSIVE - MOBILE (max-width: 768px)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.visible {
    display: block;
    z-index: 199;
  }

  .main-content {
    margin-left: 0;
    padding: calc(56px + 20px) 16px 24px;
  }

  .top-bar {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 18px 20px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .card-header {
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  table {
    font-size: 0.82rem;
  }

  th, td {
    padding: 10px 12px;
  }

  .chat-container {
    min-height: 400px;
  }

  .chat-message {
    max-width: 85%;
  }

  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 85vh;
  }

  .auth-card {
    padding: 32px 24px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  .calendar {
    font-size: 0.85rem;
  }

  .cal-grid {
    padding: 4px;
    gap: 2px;
  }

  .cal-day {
    font-size: 0.78rem;
  }

  .wizard-content {
    padding: 24px 18px;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }
}


/* ----------------------------------------------------------
   23. RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  .main-content {
    padding: calc(56px + 16px) 12px 20px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .btn {
    padding: 9px 16px;
    font-size: 0.85rem;
  }

  .chat-input-area {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 20px 18px;
  }

  .table-container {
    margin: 0 -12px;
    border-radius: 0;
  }
}


/* ----------------------------------------------------------
   24. PRINT STYLES
   ---------------------------------------------------------- */
@media print {
  .sidebar,
  .mobile-header,
  .top-bar,
  .toast-container {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .card,
  .stat-card {
    border: 1px solid #ddd;
    box-shadow: none;
  }
}
