@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700;800&display=swap');
@import "tailwindcss";

@theme {
  --color-primary:   #fd6216;
  --color-navy:      #0a1d37;

  /* Brand surfaces */
  --color-bg:                  #f9f9fd;
  --color-surface:             #ffffff;
  --color-surface-low:         #f3f3f7;
  --color-surface-container:   #edeef1;

  /* Tailwind orange overrides */
  --color-orange-50:   #fff4ee;
  --color-orange-100:  #ffe4d0;
  --color-orange-200:  #ffc9a0;
  --color-orange-500:  #fd6216;
  --color-orange-600:  #e5560f;

  --font-family-sans: 'Exo 2', sans-serif;
}

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

body {
  font-family: 'Exo 2', sans-serif;
  background: #f9f9fd;
  color: #0a1d37;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Scrollbar ===== */
.scrollbar { scrollbar-width: thin; scrollbar-color: #c7c7c7 transparent; }
.scrollbar::-webkit-scrollbar { height: 6px; width: 6px; }
.scrollbar::-webkit-scrollbar-track { background: transparent; }
.scrollbar::-webkit-scrollbar-thumb { background-color: #c7c7c7; border-radius: 9999px; }
.scrollbar::-webkit-scrollbar-thumb:hover { background-color: #9ca3af; }

/* ===== Auth / Login page ===== */
.auth-page {
  position: relative; min-height: 100vh;
  display: grid; place-items: center; padding: 20px; overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(253, 98, 22, 0.24), transparent 42%),
    radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.16), transparent 34%),
    linear-gradient(180deg, #100b2f 0%, #0c0828 52%, #07051d 100%);
}
.auth-layout {
  position: relative; z-index: 1; width: min(1120px, 100%);
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 24px; align-items: stretch;
}
.auth-visual {
  border-radius: 24px; border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08); padding: 28px;
  box-shadow: 0 24px 72px -34px rgba(0,0,0,0.72);
}
.auth-visual-kicker {
  margin: 0; display: inline-flex; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1);
  color: #ffd7c2; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 6px 10px;
}
.auth-visual h1 { margin: 16px 0 0; font-size: clamp(30px,3.4vw,42px); line-height: 1.1; color: #fff; }
.auth-visual p  { margin: 12px 0 0; color: rgba(255,255,255,0.82); }
.auth-visual img { margin-top: 18px; width: 100%; height: 280px; border-radius: 16px; object-fit: cover; }
.auth-card {
  position: relative; z-index: 1; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.22); background: rgba(255,255,255,0.96);
  box-shadow: 0 24px 72px -34px rgba(0,0,0,0.72); padding: 30px; color: #0f172a;
}
.auth-form-card  { display: flex; flex-direction: column; }
.auth-logo       { height: 52px; width: auto; object-fit: contain; margin: 0 auto; }
.auth-title      { margin: 18px 0 0; text-align: center; font-size: 32px; font-weight: 800; color: #0f172a; }
.auth-copy       { margin: 12px 0 0; text-align: center; color: #475569; }
.auth-form-grid  { margin-top: 24px; }
.auth-switch     { display: flex; justify-content: flex-end; margin-top: -2px; }
.auth-switch.split { justify-content: space-between; }
.auth-link-btn {
  border: 0; padding: 0; background: transparent;
  color: #fd6216; font-size: 13px; font-weight: 600; cursor: pointer;
}
.auth-link-btn:hover { color: #ea580c; text-decoration: underline; }
.auth-inline-msg { margin-top: 12px; }
.hint { margin: 6px 0 0; color: #64748b; font-size: 12px; }

/* ===== Shared Page Components ===== */

/* Page header */
.page-title { font-size: 1.5rem; font-weight: 700; color: #0a1d37; line-height: 1.2; }
.page-subtitle { font-size: 0.875rem; color: #64748b; margin-top: 4px; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  background: #0D0D2A;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  padding: 10px 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}
.data-table thead th:first-child { border-radius: 0; }
.data-table thead th:last-child  { border-radius: 0; }
.data-table tbody td {
  padding: 12px 20px;
  font-size: 13px;
  color: #0f172a;
  vertical-align: middle;
  border-bottom: 1px solid #F3F4F6;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #FAFAFA; }
.data-table-empty {
  text-align: center;
  padding: 32px 16px;
  font-size: 0.875rem;
  color: #94a3b8;
}

/* Table card wrapper */
.table-card {
  background: #fff;
  border-radius: 0;
  border-top: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
  border-left: none;
  border-right: none;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Sort controls row */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.sort-select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.8125rem;
  padding: 7px 28px 7px 10px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: #0a1d37; box-shadow: 0 0 0 3px rgba(10,29,55,0.08); }

/* Primary button (navy) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0a1d37;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 150ms, box-shadow 150ms;
  text-decoration: none;
}
.btn-primary:hover { background: #0f2a4e; box-shadow: 0 4px 12px rgba(10,29,55,0.25); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

/* Secondary button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #0a1d37;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  text-decoration: none;
}
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

/* Search input */
.search-input {
  width: 100%;
  max-width: 320px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 0.8125rem;
  padding: 8px 12px;
  transition: border-color 160ms, box-shadow 160ms;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus { outline: none; border-color: rgba(10,29,55,0.45); box-shadow: 0 0 0 3px rgba(10,29,55,0.08); }

/* Tab bar (orange underline style) */
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 20px; }
.tab-link {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
}
.tab-link:hover { color: #0a1d37; }
.tab-link[aria-current='page'] { color: #fd6216; border-bottom-color: #fd6216; }

/* Action icon buttons in tables */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.action-btn:hover { background: #f8fafc; color: #0a1d37; border-color: #cbd5e1; }
.action-btn.danger:hover { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-active  { background: #dcfce7; color: #166534; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-draft   { background: #f1f5f9; color: #475569; }
.status-error   { background: #fee2e2; color: #991b1b; }

/* ===== Admin Shell + Shared UI ===== */
.admin-shell-root {
  background:
    radial-gradient(circle at 92% 8%, rgba(253, 98, 22, 0.08), transparent 30%),
    radial-gradient(circle at 12% 100%, rgba(10, 29, 55, 0.08), transparent 36%),
    #f8f9fd;
}

.admin-main section.rounded-xl.border.border-gray-200.bg-white.shadow-sm {
  border-color: #e2e8f0 !important;
  box-shadow: 0 12px 28px -20px rgba(10, 29, 55, 0.34) !important;
  border-radius: 14px !important;
}

.admin-main table.w-full {
  border-collapse: separate;
  border-spacing: 0;
}

.admin-main table.w-full thead th {
  background: #0a1d37;
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: none;
  text-align: left;
  white-space: nowrap;
}

.admin-main table.w-full tbody td {
  color: #0f172a;
  font-size: 13px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}

.admin-main table.w-full tbody tr:last-child td {
  border-bottom: 0;
}

.admin-main table.w-full tbody tr:hover td {
  background: #fcfdff;
}

.admin-main input[type='text'],
.admin-main input[type='search'],
.admin-main input[type='number'],
.admin-main input[type='email'],
.admin-main input[type='url'],
.admin-main input[type='password'],
.admin-main select,
.admin-main textarea {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  transition: border-color 160ms, box-shadow 160ms;
}

.admin-main input:focus,
.admin-main select:focus,
.admin-main textarea:focus {
  border-color: rgba(10, 29, 55, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(10, 29, 55, 0.08);
  outline: none;
}

.notice {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
  padding: 14px 16px;
}

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

.list-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0a1d37;
}

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

.list-item h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: #0a1d37;
}

.admin-segmented {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.admin-segment {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 140ms ease;
}

.admin-segment:hover {
  background: #f8fafc;
  color: #0f172a;
}

.admin-segment.active {
  background: rgba(10, 29, 55, 0.10);
  color: #0a1d37;
}

.admin-segment:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.admin-link-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 3px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.admin-link-tabs a {
  border-radius: 6px;
  padding: 7px 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.admin-link-tabs a[aria-current='page'] {
  background: rgba(10, 29, 55, 0.10);
  color: #0a1d37;
}

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

.preview-tabs button {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  cursor: pointer;
}

@media (max-width: 1023px) {
  .admin-main table.w-full thead th,
  .admin-main table.w-full tbody td {
    font-size: 12px;
    padding: 10px 11px;
  }
}

/* ===== Dark Theme Coverage ===== */
html[data-theme='dark'] body {
  background: #0b1220;
  color: #e5e7eb;
}

html[data-theme='dark'] .table-card {
  background: #0f172a;
  border-color: #243041;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

html[data-theme='dark'] .data-table thead th {
  background: #111827;
  color: #e5e7eb;
}

html[data-theme='dark'] .data-table tbody td {
  color: #d1d5db;
  border-bottom-color: #243041;
}

html[data-theme='dark'] .data-table tbody tr:hover td {
  background: #111a2f;
}

html[data-theme='dark'] .data-table-empty {
  color: #94a3b8;
}

html[data-theme='dark'] .admin-main table.w-full thead th {
  background: #111827;
  color: #e5e7eb;
}

html[data-theme='dark'] .admin-main table.w-full tbody td {
  color: #d1d5db;
  border-bottom-color: #243041;
}

html[data-theme='dark'] .admin-main table.w-full tbody tr:hover td {
  background: #111a2f;
}

html[data-theme='dark'] .tab-bar {
  border-bottom-color: #243041;
}

html[data-theme='dark'] .tab-link {
  color: #9ca3af;
}

html[data-theme='dark'] .tab-link:hover {
  color: #e5e7eb;
}

html[data-theme='dark'] .tab-link[aria-current='page'] {
  color: #ff5e13;
  border-bottom-color: #ff5e13;
}

html[data-theme='dark'] .admin-link-tabs {
  border-color: #243041;
  background: #0f172a;
}

html[data-theme='dark'] .admin-link-tabs a {
  color: #9ca3af;
}

html[data-theme='dark'] .admin-link-tabs a[aria-current='page'] {
  background: rgba(255, 94, 19, 0.16);
  color: #ff8a52;
}

html[data-theme='dark'] .preview-tabs button {
  border-color: #243041;
  background: #0f172a;
  color: #cbd5e1;
}

html[data-theme='dark'] .admin-main input[type='text'],
html[data-theme='dark'] .admin-main input[type='search'],
html[data-theme='dark'] .admin-main input[type='number'],
html[data-theme='dark'] .admin-main input[type='email'],
html[data-theme='dark'] .admin-main input[type='url'],
html[data-theme='dark'] .admin-main input[type='password'],
html[data-theme='dark'] .admin-main select,
html[data-theme='dark'] .admin-main textarea {
  background: #0f172a;
  color: #e5e7eb;
  border-color: #334155;
}

html[data-theme='dark'] .admin-main input::placeholder,
html[data-theme='dark'] .admin-main textarea::placeholder {
  color: #94a3b8;
}

html[data-theme='dark'] .btn-secondary,
html[data-theme='dark'] .action-btn {
  background: #111827;
  border-color: #334155;
  color: #d1d5db;
}

html[data-theme='dark'] .btn-secondary:hover,
html[data-theme='dark'] .action-btn:hover {
  background: #1f2937;
  border-color: #475569;
}

html[data-theme='dark'] .admin-main div[style*='border-bottom:1px solid #E5E7EB'] {
  border-bottom-color: #243041 !important;
}

html[data-theme='dark'] .admin-main button[style*='padding-bottom:12px'][style*='font-size:14px'] {
  color: #94a3b8 !important;
}

html[data-theme='dark'] .admin-main button[style*='padding-bottom:12px'][style*='border-bottom:2px solid #FF5E13'] {
  color: #ff8a52 !important;
  border-bottom-color: #ff5e13 !important;
}
