@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --red-500: #f51f07;
  --red-400: #ff4d4d;
  --red-600: #d41a06;
  --red-300: #ff432e;
  --yellow-500: #f5b607;
  --yellow-400: #ffcc33;
  --yellow-600: #d49d06;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --card-bg: #ffffff;
  --card-bg-solid: #ffca97;
  --sidebar-w: 260px;
  --sidebar-collapsed: 68px;
  --header-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-md-sidebar: 0px 12px 12px 0px;
  --radius-lg: 16px;
  --radius-lg-sidebar: 0px 16px 16px 0px;
  --radius-xl: 20px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .1);
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh
}

a {
  color: var(--red-500);
  text-decoration: none;
  transition: color var(--transition)
}

a:hover {
  color: var(--red-600)
}

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

ul,
ol {
  list-style: none
}

button {
  cursor: pointer;
  font-family: inherit
}

input,
textarea,
select {
  font-family: inherit
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
  color: var(--text-primary)
}

h1 {
  font-size: 2rem;
  font-weight: 800
}

h2 {
  font-size: 1.5rem;
  font-weight: 700
}

h3 {
  font-size: 1.2rem;
  font-weight: 600
}

h4 {
  font-size: 1rem;
  font-weight: 600
}

p {
  color: var(--text-secondary)
}

.text-primary {
  color: var(--text-primary) !important
}

.text-secondary {
  color: var(--text-secondary) !important
}

.text-muted {
  color: var(--text-muted) !important
}

.text-red {
  color: var(--red-500) !important
}

.text-yellow {
  color: var(--yellow-500) !important
}

.text-gold {
  color: var(--yellow-600) !important
}

.text-green {
  color: var(--green-500) !important
}

.flex {
  display: flex
}

.flex-col {
  display: flex;
  flex-direction: column
}

.items-center {
  align-items: center
}

.justify-center {
  justify-content: center
}

.justify-between {
  justify-content: space-between
}

.gap-1 {
  gap: .5rem
}

.gap-2 {
  gap: 1rem
}

.gap-3 {
  gap: 1.5rem
}

.gap-4 {
  gap: 2rem
}

.mt-1 {
  margin-top: .5rem
}

.mt-2 {
  margin-top: 1rem
}

.mt-3 {
  margin-top: 1.5rem
}

.mt-4 {
  margin-top: 2rem
}

.mb-1 {
  margin-bottom: .5rem
}

.mb-2 {
  margin-bottom: 1rem
}

.mb-3 {
  margin-bottom: 1.5rem
}

.p-1 {
  padding: .5rem
}

.p-2 {
  padding: 1rem
}

.p-3 {
  padding: 1.5rem
}

.p-4 {
  padding: 2rem
}

.w-full {
  width: 100%
}

.h-full {
  height: 100%
}

.hidden {
  display: none !important
}

.text-sm {
  font-size: .85rem
}

.text-xs {
  font-size: .75rem
}

.text-lg {
  font-size: 1.1rem
}

.font-bold {
  font-weight: 700
}

.font-semibold {
  font-weight: 600
}

.rounded-sm {
  border-radius: var(--radius-sm)
}

.rounded {
  border-radius: var(--radius-md)
}

.rounded-lg {
  border-radius: var(--radius-lg)
}

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

.grid {
  display: grid
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem
}

.text-center {
  text-align: center
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition)
}

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

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md)
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-500), var(--red-400));
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 31, 7, .3)
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 31, 7, .5);
  color: #fff
}

.btn-teal {
  background: linear-gradient(135deg, var(--yellow-500), var(--yellow-400));
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(245, 182, 7, .3)
}

.btn-teal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 182, 7, .4);
  color: var(--text-primary)
}

.btn-gold {
  background: linear-gradient(135deg, var(--yellow-500), var(--yellow-400));
  color: var(--text-primary);
  box-shadow: 0 4px 15px rgba(245, 182, 7, .3)
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 182, 7, .4);
  color: var(--text-primary)
}

.btn-danger {
  background: linear-gradient(135deg, var(--red-500), var(--red-400));
  color: #fff
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, .4);
  color: #fff
}

.btn-ghost {
  background: rgba(0, 0, 0, .03);
  color: var(--text-primary);
  border: 1px solid var(--border)
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, .06);
  border-color: var(--border-hover);
  color: var(--text-primary)
}

.btn-sm {
  padding: .4rem .9rem;
  font-size: .8rem
}

.btn-lg {
  padding: .85rem 2rem;
  font-size: 1rem
}

.btn-icon {
  padding: .6rem;
  border-radius: var(--radius-sm)
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem
}

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .5rem
}

.form-control {
  width: 100%;
  padding: .7rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none
}

.form-control:focus {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(245, 31, 7, .1)
}

.form-control::placeholder {
  color: var(--text-muted)
}

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

select.form-control option {
  background: #fff
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600
}

.badge-indigo {
  background: rgba(245, 31, 7, .1);
  color: var(--red-500)
}

.badge-teal {
  background: rgba(245, 182, 7, .1);
  color: var(--yellow-600)
}

.badge-green {
  background: rgba(39, 174, 96, .1);
  color: var(--green-500)
}

.badge-red {
  background: rgba(245, 31, 7, .1);
  color: var(--red-500)
}

.badge-gold {
  background: rgba(245, 182, 7, .1);
  color: var(--yellow-600)
}

.badge-muted {
  background: rgba(100, 116, 139, .2);
  color: var(--text-muted)
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border)
}

table {
  width: 100%;
  border-collapse: collapse
}

thead tr {
  background: rgba(67, 97, 238, .1)
}

th {
  padding: .85rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  text-align: left
}

td {
  padding: .85rem 1rem;
  font-size: .9rem;
  border-top: 1px solid var(--border)
}

tr:hover td {
  background: rgba(0, 0, 0, .01)
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start
}

.alert-success {
  background: rgba(46, 204, 113, .15);
  border: 1px solid rgba(46, 204, 113, .3);
  color: var(--green-400)
}

.alert-error {
  background: rgba(231, 76, 60, .15);
  border: 1px solid rgba(231, 76, 60, .3);
  color: var(--red-400)
}

.alert-info {
  background: rgba(76, 201, 240, .15);
  border: 1px solid rgba(76, 201, 240, .3);
  color: var(--teal-400)
}

.alert-warning {
  background: rgba(244, 162, 97, .15);
  border: 1px solid rgba(244, 162, 97, .3);
  color: var(--gold-400)
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition)
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible
}

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition);
  max-height: 90vh;
  overflow-y: auto
}

.modal-overlay.open .modal {
  transform: translateY(0)
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1
}

.modal-close:hover {
  color: var(--text-primary)
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border)
}

/* Progress */
.progress-bar {
  background: rgba(0, 0, 0, .05);
  border-radius: 999px;
  height: 8px;
  overflow: hidden
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red-500), var(--yellow-500));
  transition: width .5s ease
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 0, 0, .05);
  border-top-color: var(--red-500);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 2rem auto
}

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

/* Toast */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .75rem
}

.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .9rem 1.25rem;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  animation: toastIn .3s ease;
  max-width: 360px;
  color: var(--text-primary)
}

.toast.out {
  animation: toastOut .3s ease forwards
}

@keyframes toastIn {
  from {
    transform: translateY(-100%);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

@keyframes toastOut {
  from {
    transform: translateY(0);
    opacity: 1
  }

  to {
    transform: translateY(-100%);
    opacity: 0
  }
}

.toast-success {
  border-left: 3px solid var(--green-500)
}

.toast-error {
  border-left: 3px solid var(--red-500)
}

.toast-info {
  border-left: 3px solid var(--red-400)
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.page-fade {
  animation: fadeIn .35s ease
}

/* Quill overrides */
.ql-toolbar {
  background: #f8f9fa !important;
  border: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important
}

.ql-container {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  min-height: 180px
}

.ql-editor {
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  min-height: 180px
}

.ql-toolbar .ql-stroke {
  stroke: var(--text-secondary) !important
}

.ql-toolbar .ql-fill {
  fill: var(--text-secondary) !important
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar .ql-active .ql-stroke {
  stroke: var(--red-500) !important
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar .ql-active .ql-fill {
  fill: var(--red-500) !important
}

.ql-picker {
  color: var(--text-secondary) !important
}

.ql-picker-options {
  background: #fff !important;
  border: 1px solid var(--border) !important
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px
}

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

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  padding: 2rem
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg)
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 2rem
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800
}

.auth-sub {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .25rem
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--red-500), var(--yellow-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff
}

/* ── Admin Layout ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--red-500);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
  color: #ffffff;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar .sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: var(--header-h);
}

.sidebar .brand-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #ffffff;
}

.sidebar .brand-sub {
  font-size: .75rem;
  color: rgba(255, 255, 255);
  text-transform: uppercase;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1.25rem;
  color: rgba(255, 255, 255, 0.918);
  text-decoration: none;
  transition: all 0.2s;
  border-radius: var(--radius-md);
  margin: 0.25rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.767);
  color: #ffffff;
}

.sidebar .nav-item.active {
  background: var(--yellow-500);
  color: var(--text-primary);
  font-weight: 700;
}

.sidebar .nav-section {
  padding: 1.25rem 1.5rem .5rem;
  font-size: .7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section {
  display: none;
}

.admin-header {
  position: fixed;
  top: 0;
  right: 0;
  height: var(--header-h);
  left: var(--sidebar-w);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--yellow-500);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  transition: left 0.3s ease;
}

.admin-header.collapsed {
  left: var(--sidebar-collapsed);
}

.admin-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 2rem;
  min-height: calc(100vh - var(--header-h));
  transition: margin-left 0.3s ease;
}

.admin-main.collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* Responsive */
@media(max-width:900px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr)
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:600px) {

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr
  }

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

@media print {

  .sidebar,
  .admin-header,
  .user-header,
  .btn {
    display: none !important
  }

  .admin-main,
  .user-main {
    margin: 0 !important;
    padding: 1rem !important
  }
}