/**
 * StopWord modern theme
 * Overrides the stock NiceAdmin template (css/style.css) with a teal/slate
 * design system. Loaded after style.css so these rules win on equal specificity.
 */

:root {
  /* Force native form widgets (file picker, select popup, checkboxes) to
     render light even when the OS/browser is in dark mode — otherwise
     Chrome auto-styles them dark-on-dark against our light UI. */
  color-scheme: light;

  --sw-primary: #0f766e;
  --sw-primary-dark: #0b5c56;
  --sw-primary-light: #14b8a6;
  --sw-accent: #155e75;
  --sw-ink-900: #0b1220;
  --sw-ink-800: #101a2c;
  --sw-ink-700: #16233a;
  --sw-surface: #f4f7fb;
  --sw-card: #ffffff;
  --sw-border: #e2e8f0;
  --sw-muted: #64748b;
  --sw-text: #1e293b;
  --sw-radius: 0.9rem;
  --sw-radius-sm: 0.6rem;
  --sw-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --sw-shadow-hover: 0 4px 10px rgba(15, 23, 42, 0.06), 0 16px 32px rgba(15, 23, 42, 0.09);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--sw-surface);
  color: var(--sw-text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sw-primary);
}

a:hover {
  color: var(--sw-primary-dark);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

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

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

/* ---------- Page title ---------- */
.pagetitle h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--sw-ink-900);
  letter-spacing: -0.01em;
}

.pagetitle .breadcrumb {
  font-size: 0.82rem;
}

.pagetitle .breadcrumb-item a {
  color: var(--sw-muted);
  font-weight: 600;
}

.pagetitle .breadcrumb-item.active {
  color: var(--sw-primary);
  font-weight: 600;
}

/* ---------- Header ---------- */
.header {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 1px 0 var(--sw-border);
  border-bottom: 1px solid var(--sw-border);
}

.header .toggle-sidebar-btn {
  color: var(--sw-muted);
}

.header-nav .nav-icon {
  color: var(--sw-muted);
}

.header-nav .nav-profile img {
  border: 2px solid var(--sw-border);
}

.avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-accent) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.header-nav .nav-profile span {
  color: var(--sw-ink-900);
  font-weight: 700;
}

.dropdown-menu {
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-sm);
  box-shadow: var(--sw-shadow-hover);
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--sw-ink-900) 0%, var(--sw-ink-700) 100%);
  box-shadow: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.sidebar::-webkit-scrollbar {
  background-color: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.18);
}

.sidebar-nav .nav-heading {
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.08em;
  margin: 18px 0 8px 12px;
}

.sidebar-nav .nav-item {
  margin-bottom: 3px;
}

.sidebar-nav .nav-link,
.sidebar-nav .nav-link.collapsed {
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border-radius: var(--sw-radius-sm);
  font-weight: 600;
  padding: 10px 12px;
}

.sidebar-nav .nav-link i,
.sidebar-nav .nav-link.collapsed i {
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.collapsed:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link:hover i,
.sidebar-nav .nav-link.collapsed:hover i {
  color: var(--sw-primary-light);
}

.sidebar-nav .nav-link:not(.collapsed) {
  color: #fff;
  background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-accent) 100%);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.sidebar-nav .nav-link:not(.collapsed) i {
  color: #fff;
}

.sidebar-nav .nav-link.active,
.sidebar-nav a#nav_datatable:not(.collapsed) {
  color: #fff;
  background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-accent) 100%);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.sidebar-nav .nav-content a {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 600;
  border-radius: var(--sw-radius-sm);
  padding: 8px 0 8px 40px;
}

.sidebar-nav .nav-content a i {
  color: rgba(255, 255, 255, 0.35);
}

.sidebar-nav .nav-content a:hover,
.sidebar-nav .nav-content a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav .nav-content a.active i {
  background-color: var(--sw-primary-light);
}

/* ---------- Sections ---------- */
.section {
  margin-bottom: 1.5rem;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius);
  box-shadow: var(--sw-shadow);
}

.card .card-title {
  color: var(--sw-ink-900);
  font-weight: 700;
}

.card-header {
  background-color: var(--sw-card);
  border-bottom: 1px solid var(--sw-border);
  border-radius: var(--sw-radius) var(--sw-radius) 0 0 !important;
  font-weight: 700;
  color: var(--sw-ink-900);
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--sw-radius-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-accent) 100%);
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--sw-primary-dark) 0%, #0e4f61 100%);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.32);
}

.btn-outline-primary {
  color: var(--sw-primary);
  border-color: var(--sw-primary);
}

.btn-outline-primary:hover {
  background: var(--sw-primary);
  border-color: var(--sw-primary);
}

.btn-outline-secondary {
  border-color: var(--sw-border);
  color: var(--sw-muted);
}

.btn-success {
  background: #0f9d58;
  border-color: transparent;
}

.btn-outline-danger:hover {
  box-shadow: 0 6px 14px rgba(220, 53, 69, 0.2);
}

.btn-light {
  border-color: transparent;
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
  border-radius: var(--sw-radius-sm);
  border-color: var(--sw-border);
  background-color: #fbfcfe;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sw-primary-light);
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.18);
  background-color: #fff;
}

.form-label {
  font-weight: 600;
  color: var(--sw-ink-800);
  font-size: 0.85rem;
}

/* ---------- Tables ---------- */
.table {
  --bs-table-hover-bg: rgba(15, 118, 110, 0.05);
}

.table thead th {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--sw-muted);
  font-weight: 700;
  border-bottom-color: var(--sw-border);
  background-color: #fafbfd;
}

.table td,
.table th {
  border-color: var(--sw-border);
  vertical-align: middle;
}

/* ---------- Alerts & badges ---------- */
.alert {
  border: 1px solid transparent;
  border-radius: var(--sw-radius-sm);
}

.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge.rounded-pill {
  padding-top: 0.45em;
  padding-bottom: 0.45em;
}

/* ---------- Misc ---------- */
.back-to-top {
  background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-accent) 100%) !important;
}

/* ---------- Auth pages (layout.sign) ---------- */
.auth-shell {
  min-height: 100vh;
  width: 100%;
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(20, 184, 166, 0.16), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(21, 94, 117, 0.16), transparent 55%),
    var(--sw-surface);
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--sw-card);
  border: 1px solid var(--sw-border);
  border-radius: 1.1rem;
  box-shadow: var(--sw-shadow-hover);
  overflow: hidden;
}

.auth-card .auth-card-accent {
  height: 6px;
  background: linear-gradient(90deg, var(--sw-primary) 0%, var(--sw-accent) 100%);
}

.auth-card .auth-card-body {
  padding: 2.25rem 2rem;
}

.auth-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-accent) 100%);
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.3);
}

.auth-card h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sw-ink-900);
}

.auth-card .auth-subtitle {
  color: var(--sw-muted);
  font-size: 0.9rem;
}

.auth-card .form-label {
  font-size: 0.82rem;
}

.auth-footnote {
  text-align: center;
  font-size: 0.85rem;
  color: var(--sw-muted);
  margin-top: 1.25rem;
}

.auth-footnote a {
  font-weight: 700;
}
