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

:root {
  --primary: #df1a50;
  --primary-light: #F74D67;
  --primary-dark: #b8143f;
  --primary-gradient: linear-gradient(135deg, #df1a50, #F74D67);
  --bg-white: #ffffff;
  --bg-light: #FBFBFB;
  --bg-gray: #F4F4F5;
  --bg-sidebar: #0e0c1b;
  --bg-input: #ffffff;
  --text-dark: #0e0c1b;
  --text-body: #6e6d76;
  --text-light: #999999;
  --text-muted: #aaaaaa;
  --border: #DFDFE2;
  --border-light: #eeeeee;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --sidebar-width: 260px;
  --transition: all 0.3s ease;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-gray);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-dark);
}

::selection { background: var(--primary); color: white; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-gray); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

a { text-decoration: none; color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gray);
  position: relative;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--bg-sidebar);
}

.login-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 50px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
}

.login-logo {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.login-logo span {
  font-size: 0.65em;
  color: var(--text-light);
  font-weight: 400;
  display: block;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: -5px;
}

.login-subtitle {
  color: var(--text-light);
  margin-bottom: 35px;
  font-size: 0.9rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.85rem;
  display: none;
}

/* ===== LAYOUT ===== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 25px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

.sidebar-logo span {
  font-size: 0.55em;
  color: var(--primary-light);
  font-weight: 400;
  letter-spacing: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 15px 0;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  color: white;
  border-left-color: var(--primary);
  background: rgba(223, 26, 80, 0.1);
}

.sidebar-link.active i {
  color: var(--primary-light);
}

.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-badge {
  position: absolute;
  right: 15px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 0;
  transition: var(--transition);
  background: none;
  border: none;
  font-family: inherit;
  width: 100%;
}

.sidebar-logout:hover { color: var(--danger); }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-gray);
}

.top-bar {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.top-bar h1 {
  font-size: 1.4rem;
  font-weight: 600;
}

.top-bar-actions { display: flex; align-items: center; gap: 15px; }

.content { padding: 30px; }

/* Mobile sidebar */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 5px;
}

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

.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
  .sidebar { left: -260px; }
  .sidebar.open { left: 0; }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .content { padding: 20px 15px; }
  .top-bar { padding: 15px 20px; }
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(223, 26, 80, 0.1);
}

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

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6d76' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

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

@media (max-width: 576px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-gold,
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-gold:hover,
.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(223, 26, 80, 0.3);
}

.btn-outline {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-body);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(223, 26, 80, 0.04);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-success {
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { padding: 8px 10px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.stat-card-icon {
  width: 55px;
  height: 55px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-card-icon.gold { background: rgba(223, 26, 80, 0.08); color: var(--primary); }
.stat-card-icon.blue { background: rgba(59, 130, 246, 0.08); color: var(--info); }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.08); color: var(--success); }
.stat-card-icon.red { background: rgba(239, 68, 68, 0.08); color: var(--danger); }

.stat-card-number {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-dark);
}

.stat-card-label {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ===== TABLES ===== */
.table-wrapper {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-header {
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 10px;
}

.table-search {
  padding: 8px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  min-width: 200px;
}

.table-search:focus { border-color: var(--primary); }

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

thead th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-light);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
}

tbody tr:hover {
  background: var(--bg-light);
}

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

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

@media (max-width: 768px) {
  .table-wrapper { overflow-x: auto; }
  table { min-width: 600px; }
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-gold,
.badge-primary { background: rgba(223, 26, 80, 0.08); color: var(--primary); }

/* ===== TOGGLE ===== */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 50px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 12, 27, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

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

.modal-body { padding: 25px; }

.modal-footer {
  padding: 15px 25px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== TOASTS ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  min-width: 280px;
  box-shadow: var(--shadow-md);
}

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

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== FILE UPLOAD ===== */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-light);
}

.file-upload:hover {
  border-color: var(--primary);
  background: rgba(223, 26, 80, 0.03);
}

.file-upload i { font-size: 2rem; color: var(--text-light); margin-bottom: 10px; }
.file-upload p { color: var(--text-light); font-size: 0.85rem; }

.file-upload input[type="file"] { display: none; }

.preview-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.preview-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-light);
}

.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== DETAILS LIST (for services) ===== */
.details-list { margin-top: 10px; }

.details-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.details-item input { flex: 1; }

.details-item .btn-icon {
  flex-shrink: 0;
  padding: 8px;
}

/* ===== SECTION CARD ===== */
.section-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}

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

.section-card-header h3 { font-size: 1rem; font-weight: 600; }
.section-card-header h3 i { color: var(--primary); }

.section-card-body { padding: 25px; }

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== LOADING ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state i { font-size: 3rem; margin-bottom: 15px; display: block; color: var(--border); }
