/* AliChart – shared styles (login + dashboards) */

:root {
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #1a202c;
  --text-muted: #4a5568;
  --accent: #2c5282;
  --accent-hover: #2b6cb0;
  --border: #e2e8f0;
  --error: #c53030;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ----- Login page ----- */

.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(160deg, #e8eef4 0%, #d6e4f0 50%, #e2eaf2 100%);
}

.login-wrap {
  width: 100%;
  max-width: 420px;
}

.app-title-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.app-title-logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.app-title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  letter-spacing: -0.02em;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border);
}

.login-card .card-title {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.login-form label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.login-form input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.2);
}

.login-form .btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.error-msg {
  margin: 0 0 1rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--error);
  background: #fff5f5;
  border-radius: var(--radius-sm);
  border: 1px solid #feb2b2;
}

.error-msg[hidden] {
  display: none;
}

.demo-accounts {
  margin: 1.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.demo-accounts strong {
  color: var(--text);
}

/* ----- Buttons ----- */

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-delete {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-delete:hover {
  color: var(--error);
  border-color: #feb2b2;
  background: #fff5f5;
}

.section-actions {
  margin: 0.75rem 0 0;
  padding-top: 0.5rem;
}

/* ----- Dashboard layout ----- */

.dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.dashboard-header {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.dashboard-welcome {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.dashboard-signout {
  font-size: 0.9375rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.dashboard-signout:hover {
  text-decoration: underline;
}

.demo-banner {
  width: 100%;
  max-width: 800px;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: #ebf8ff;
  border: 1px solid #90cdf4;
  border-radius: var(--radius-sm);
}

.demo-banner[hidden] {
  display: none;
}

.dashboard-sections {
  width: 100%;
  max-width: 800px;
  display: grid;
  gap: 1.5rem;
}

.dashboard-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.dashboard-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-section p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.section-desc {
  margin-bottom: 1rem !important;
}

.dashboard-form label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.dashboard-form input,
.dashboard-form select {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
}

.dashboard-form input:focus,
.dashboard-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.dashboard-form .btn {
  margin-top: 0.25rem;
}

.form-feedback {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.form-feedback-success {
  color: #276749;
}

.form-feedback-error {
  color: var(--error);
}

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.appointment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.9375rem;
}

.appointment-row .apt-time {
  font-weight: 500;
  min-width: 10rem;
}

.appointment-row .apt-status {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  text-transform: capitalize;
}

.appointment-row .status-scheduled {
  background: #ebf8ff;
  color: #2b6cb0;
}

.appointment-row .status-checked_in {
  background: #faf089;
  color: #744210;
}

.appointment-row .status-completed {
  background: #c6f6d5;
  color: #276749;
}

.appointment-row .status-cancelled {
  background: #fed7d7;
  color: #c53030;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  margin-left: auto;
}

/* ----- Responsive ----- */

@media (max-width: 480px) {
  .page-login {
    padding: 1rem;
  }

  .app-title {
    font-size: 1.875rem;
  }

  .card {
    padding: 1.5rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
