/* Svenn Admin UI — Clean Light Theme */

/* ── Poppins Font ── */

@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-hover: #ebebef;
  --border: #e0e0e8;
  --border-hover: #c8c8d4;
  --text: #1a1a2e;
  --text-secondary: #3a3a50;
  --text-muted: #5f5f78;
  --primary: #E93D82;
  --primary-hover: #D32D6C;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 0;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/images/dashboardbg.jpg');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: -1;
}

/* ── Layout ── */

.app-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-header .logo {
  height: 32px;
  width: auto;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

.app-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}

.app-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header .header-right a {
  text-decoration: none;
}

.container {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px 60px;
}

/* ── Auth gate ── */

#auth-gate {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

#auth-gate label {
  text-align: left;
}


/* Hero background for login screen */
.auth-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#auth-gate .auth-card {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

#auth-gate h2 {
  margin-bottom: 8px;
  font-size: 1.3rem;
  color: var(--text);
}

/* ── Cards / Sections ── */

.card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.card h3 {
  color: var(--text-secondary);
}

/* ── Forms ── */

label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 12px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(233, 61, 130, 0.15);
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row > * {
  flex: 1;
  min-width: 120px;
}

/* ── Buttons ── */

button, .btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

/* ── Tables ── */

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

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

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover {
  background: var(--surface-hover);
}

/* ── Status badges ── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-confirmed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-completed { background: rgba(120, 120, 138, 0.15); color: var(--text-muted); }
.badge-canceled { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ── Tabs ── */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.tab {
  padding: 8px 18px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.82rem;
  background: none;
  border: none;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
}

.tab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Alerts ── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success { background: rgba(16, 185, 129, 0.1); color: #047857; }
.alert-error { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #92400e; }

/* ── Toggle ── */

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

/* ── Hours grid ── */

.hours-grid {
  display: grid;
  grid-template-columns: 60px 1fr 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
}

.hours-grid label {
  margin: 0;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text-secondary);
}

.hours-grid input {
  margin: 0;
  padding: 8px;
}

/* ── Misc ── */

.hidden { display: none !important; }

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ── Toast ── */

#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 24px;
  border-radius: var(--radius);
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

#toast.success { background: var(--success); }
#toast.error { background: var(--danger); }

/* ── Help tab ── */

.help-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.help-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.help-item h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.help-item p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Subscription card ── */

.sub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.sub-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sub-details {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 24px;
}

.sub-detail-item {
  text-align: center;
}

.sub-detail-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.sub-detail-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-past_due { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-canceled { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-none { background: rgba(120, 120, 138, 0.15); color: var(--text-muted); }
.badge-trialing { background: rgba(233, 61, 130, 0.15); color: var(--primary); }

.sub-cancel-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--warning);
  margin-bottom: 20px;
}

.sub-card .btn {
  width: 100%;
  padding: 12px;
}

.sub-card .text-muted {
  font-size: 0.8rem;
  margin-top: 10px;
}

/* ── Masquerade banner ── */

.masquerade-banner {
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.masquerade-banner .btn {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.75rem;
}

.masquerade-banner .btn:hover {
  background: rgba(245, 158, 11, 0.3);
}

/* ── Tickets ── */

.ticket-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ticket-header strong {
  font-size: 0.9rem;
}

.ticket-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.ticket-response {
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.ticket-response-provider {
  background: rgba(233, 61, 130, 0.08);
  border-left: 3px solid var(--primary);
}

.ticket-response-admin {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--success);
}

.ticket-response-from {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.ticket-response p {
  color: var(--text-secondary);
  margin: 0;
}

.ticket-reply {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.ticket-reply input {
  flex: 1;
  margin: 0;
}

.ticket-reply .btn {
  white-space: nowrap;
}

/* ── Integration cards ── */

.integration-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.integration-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.integration-card-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.integration-card-content > p {
  font-size: 0.82rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Telegram */
.telegram-card {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.08), rgba(0, 136, 204, 0.04));
  border: 1px solid rgba(0, 136, 204, 0.2);
}

.telegram-icon {
  background: rgba(0, 136, 204, 0.12);
  color: #0088cc;
}

/* Facebook Messenger */
.facebook-card {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.08), rgba(24, 119, 242, 0.04));
  border: 1px solid rgba(24, 119, 242, 0.2);
}

.facebook-icon {
  background: rgba(24, 119, 242, 0.12);
  color: #1877F2;
}

/* Instagram */
.instagram-card {
  background: linear-gradient(135deg, rgba(228, 64, 95, 0.08), rgba(131, 58, 180, 0.04));
  border: 1px solid rgba(193, 53, 132, 0.2);
}

.instagram-icon {
  background: linear-gradient(135deg, rgba(228, 64, 95, 0.15), rgba(131, 58, 180, 0.15));
  color: #C13584;
}

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
