/* Custom CSS — only what Tailwind cannot do */
:root {
  --sidebar-w: 270px;
}

/* Login glassmorphism */
.auth-body {
  background: #0f172a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-body::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  top: -200px; right: -200px;
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}
.auth-body::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(225,29,72,0.1) 0%, transparent 70%);
  bottom: -150px; left: -150px;
  border-radius: 50%;
  animation: float 10s ease-in-out infinite reverse;
  pointer-events: none;
}
.grid-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}
.login-wrapper { position: relative; z-index: 2; width: 100%; max-width: 440px; padding: 1rem; }
.login-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand .icon-wrap {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  background: linear-gradient(135deg, #6366f1, #e11d48);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; color: #fff;
  box-shadow: 0 8px 24px rgba(99,102,241,0.3);
}
.login-brand h2 { font-weight: 700; color: #fff; font-size: 1.35rem; margin-bottom: 0.25rem; }
.login-brand p { color: #94a3b8; font-size: 0.875rem; margin-bottom: 0; }
.alert-custom {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(225,29,72,0.15);
  border: 1px solid rgba(225,29,72,0.3);
  border-radius: 0.625rem;
  color: #fca5a5; font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.role-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 1.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 1rem; padding: 0.375rem;
}
.role-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem; border: none; background: transparent;
  color: #94a3b8; font-size: 0.875rem; font-weight: 500;
  border-radius: 0.625rem; cursor: pointer; transition: 0.2s;
  font-family: inherit;
}
.role-tab:hover { color: #fff; background: rgba(255,255,255,0.05); }
.role-tab.active { background: rgba(99,102,241,0.25); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.2); }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-form.hidden { display: none; }
.login-form .form-group { position: relative; }
.login-form .input-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: #64748b; font-size: 1rem; z-index: 1; pointer-events: none;
}
.login-form input {
  padding-left: 2.75rem; padding-right: 2.75rem; height: 48px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 0.625rem; color: #fff; font-size: 0.9rem;
  outline: none; width: 100%;
}
.login-form input:focus {
  background: rgba(255,255,255,0.08);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.login-form input::placeholder { color: #64748b; }
.password-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #64748b;
  cursor: pointer; padding: 0.25rem; z-index: 1; line-height: 1;
}
.password-toggle:hover { color: #cbd5e1; }
.btn-login {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 48px; border: none; border-radius: 0.625rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: 0.2s; font-family: inherit; width: 100%;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.35); }
.btn-login .spinner {
  display: none; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-login.loading .btn-text { visibility: hidden; }
.btn-login.loading .spinner { display: block; position: absolute; }
.login-footer { text-align: center; margin-top: 1.5rem; color: #64748b; font-size: 0.8rem; }
.login-footer small { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Password reset page styles */
.login-forgot-link {
  text-align: right;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}
.login-forgot-link a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.login-forgot-link a:hover {
  color: #6366f1;
}
.login-links {
  text-align: center;
  margin-top: 1.5rem;
}
.login-links p {
  margin: 0;
}
.link-secondary {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
.link-secondary:hover {
  color: #6366f1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1a1a3e 100%);
  color: #fff; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

/* Editor content */
.ec-description img { max-width: 100%; height: auto; border-radius: 0.375rem; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* DataTables reskin (minimal) */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #d1d5db; border-radius: 0.375rem;
  padding: 0.375rem 0.75rem; font-size: 0.875rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.25rem 0.75rem; border-radius: 0.375rem;
}
table.dataTable { border-collapse: collapse; }

/* Modernisation DataTable */
table.dataTable thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 10px 12px;
  border-bottom: 2px solid #e5e7eb;
  background: #f9fafb;
}
table.dataTable tbody td {
  padding: 8px 12px;
  font-size: 0.8rem;
  border-bottom: 1px solid #f3f4f6;
}
table.dataTable tbody tr:hover td {
  background: #f3f4f6;
}
table.dataTable tbody tr.selected td {
  background: #e5e7eb !important;
}
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 6px;
}
.dataTables_wrapper .dataTables_filter label {
  font-size: 0.8rem;
  color: #6b7280;
}
.dataTables_wrapper .dataTables_filter input {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  outline: none;
  margin-left: 0.4rem;
  width: 200px;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.dataTables_wrapper .dataTables_length select {
  padding: 0.3rem 0.6rem;
  border-radius: 0.375rem;
}
.dataTables_wrapper .dataTables_info {
  font-size: 0.75rem;
  color: #9ca3af;
  padding-top: 8px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280 !important;
  margin: 0 1px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f3f4f6 !important;
  border-color: #d1d5db !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.4;
  cursor: default;
}

/* Mobile sidebar */
@media (max-width: 1023px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.show { transform: translateX(0); }
}
