@import url('/js/notifications-bell.css');
@import url('/styles/theme.css');
@import url('/fonts.css');
@import url('/styles/layout-shell.css');
@import url('/components/atoms/button.css');
@import url('/components/atoms/input.css');
@import url('/sidebar-nav.css');
@import url('/responsive.css');

.auth-form-footer {
  width: 100%;
  text-align: center;
  margin-top: 32px;
}
.auth-card-footer {
  width: 100%;
  text-align: center;
  margin-top: 32px;
  margin-bottom: 0;
}
/* Footer for login form */
/* Footer for auth-card (login box) */
.auth-card-footer {
  width: 100%;
  text-align: center;
  margin-top: 32px;
  margin-bottom: 0;
}
/* Landing Home Button for Admin Login */
.btn-landing-home {
  display: inline-block;
  margin: 18px 0 12px 0;
  padding: 12px 32px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 32px;
  box-shadow: 0 2px 12px rgba(102,126,234,0.12);
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  letter-spacing: 0.5px;
}
.btn-landing-home:hover, .btn-landing-home:focus {
  background: linear-gradient(90deg, #764ba2 0%, #667eea 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(102,126,234,0.18);
  transform: translateY(-2px) scale(1.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --admin-menu-font-size: 15px;
  --admin-menu-label-size: 12px;
  --admin-menu-font-weight: 500;
  --admin-menu-line-height: 1.35;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 24px;
}

body:not(.admin-page) {
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Header */
h1 {
  color: white;
  padding: 0;
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid #667eea;
}

/* Controls Section */
#controls {
  padding: 24px 32px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Buttons */
button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(60, 141, 188, 0.28);
  outline-offset: 2px;
}

button:active {
  transform: translateY(0);
}

#refresh {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

#new-item {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

#export-excel {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

/* Search Box */
.search-box {
  padding: 20px 32px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-bottom: 1px solid #e9ecef;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.search-field {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-field label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.admin-nav-link.is-hidden {
  display: none;
}

.search-field select {
  padding: 10px 12px;
  border: 2px solid #667eea;
  flex: 1;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-field select:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

.search-box button {
  padding: 12px 24px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  align-self: flex-end;
}

.search-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(245, 87, 108, 0.3);
}

/* Table Section */
#list {
  padding: 32px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid #e9ecef;
  color: #495057;
  font-size: 14px;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: #f8f9fa;
  transform: scale(1.01);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Table Action Buttons */
td button {
  padding: 6px 12px;
  font-size: 12px;
  margin: 0 4px;
}

.edit {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.del {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

/* Form Section */
#form {
  padding: 32px;
  background: #f8f9fa;
  border-top: 2px solid #e9ecef;
}

#form.hidden {
  display: none;
}

#training-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#training-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

#training-form input,
#training-form textarea,
#training-form select {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  font-family: inherit;
}

/* Auto-filled readonly inputs */
#training-form input[readonly] {
  background: #fffbea;
  border-color: #fbbf24;
  cursor: not-allowed;
}

#training-form input:focus,
#training-form textarea:focus,
#training-form select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#training-form textarea {
  resize: vertical;
  min-height: 100px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}

#training-form button[type="submit"] {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
  padding: 14px 32px;
}

#training-form button[type="button"] {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  padding: 14px 32px;
}

/* Message */
#msg {
  padding: 16px;
  margin: 24px 32px;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#msg.success {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #155724;
  border: 2px solid #c3e6cb;
}

#msg.error {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: 2px solid #f5c6cb;
}

/* Pagination buttons */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 24px;
    padding: 20px;
  }

  #controls {
    padding: 16px;
  }

  #list,
  #form {
    padding: 16px;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  #training-form {
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

/* Auth pages */
.auth-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  flex: 1;
}

.auth-card {
  width: min(1120px, 100%);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(27, 31, 53, 0.28);
  overflow: hidden;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 640px;
}

.auth-hero-panel {
  padding: 52px 48px;
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 22%),
    radial-gradient(circle at 85% 35%, rgba(255, 255, 255, 0.16), transparent 18%),
    linear-gradient(160deg, #0f766e 0%, #1455c0 45%, #6d28d9 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.auth-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.22);
}

.auth-hero-panel h1 {
  font-size: clamp(40px, 5vw, 56px);
  line-height: 0.95;
  margin-bottom: 14px;
}

.auth-subtle {
  max-width: 560px;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.7;
}

.auth-feature-list {
  display: grid;
  gap: 14px;
}

}

.auth-feature-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.auth-hero-panel-register {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 22%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(160deg, #9a3412 0%, #ea580c 38%, #f59e0b 100%);
}

.auth-form-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);
  padding: 52px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-head {
  margin-bottom: 28px;
}

.auth-form-head h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: 32px;
  color: #182127;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.subtle {
  color: #5b6472;
  line-height: 1.6;
}

.auth-hero-panel .auth-subtle {
  color: #ffffff;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #2a3342;
}

.auth-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d6dceb;
  border-radius: 14px;
  background: #ffffff;
  font-size: 15px;
}

.auth-form input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.auth-password-field {
  position: relative;
}

.auth-password-field input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
  cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
  color: #2563eb;
  background: #eff6ff;
  transform: translateY(-50%);
}

.auth-password-toggle svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.auth-submit {
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
  color: white;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.auth-submit:disabled {
  opacity: 0.7;
}

.auth-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe2e2 0%, #ffd3d3 100%);
  color: #8a2433;
  font-weight: 600;
}

.auth-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.auth-field-hint.success {
  color: #15803d;
}

.auth-field-hint.error {
  color: #b91c1c;
}

.auth-note {
  margin-top: 16px;
  font-size: 13px;
}

.auth-footer {
  margin-top: 18px;
  font-size: 14px;
}

.auth-footer a {
  font-weight: 700;
  color: #1455c0;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-hero-panel,
  .auth-form-panel {
    padding: 32px 24px;
  }

  .auth-field-grid {
    grid-template-columns: 1fr;
  }

  .auth-hero-panel h1 {
    font-size: 40px;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    min-height: calc(100vh - 24px);
  }

  .auth-card {
    border-radius: 22px;
  }

  .auth-hero-panel,
  .auth-form-panel {
    padding: 24px 18px;
  }

  .auth-hero-panel h1 {
    font-size: 34px;
  }

  .auth-feature-item {
    grid-template-columns: 1fr;
  }
}

/* Admin shell pages */
body.admin-page {
  background: #f4f6f9;
  padding: 0;
}

.admin-panel-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: linear-gradient(180deg, #343a40 0%, #1f242a 100%);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-home-brand {
  cursor: pointer;
  border-radius: 12px;
  margin: -4px -4px 14px;
  padding: 4px 4px 18px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.sidebar-home-brand:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-home-brand:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.65);
  outline-offset: 2px;
}

.admin-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(60, 141, 188, 0.12), 0 10px 20px rgba(0, 0, 0, 0.18);
}

.admin-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-brand h1 {
  font-size: 20px;
  margin: 0 0 3px;
  padding: 0;
  color: #fff;
}

.admin-brand p {
  color: #c2c7d0;
  font-size: 12px;
}

.admin-sidebar-user {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar-label {
  font-size: var(--admin-menu-label-size);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c2c7d0;
}

.admin-sidebar-nav {
  display: grid;
  gap: 6px;
  align-content: start;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: #c2c7d0;
  text-decoration: none;
  font-size: var(--admin-menu-font-size);
  font-weight: var(--admin-menu-font-weight);
  line-height: var(--admin-menu-line-height);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: rgba(60, 141, 188, 0.28);
  color: #fff;
}

.admin-nav-link.active {
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.35);
}

.menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.menu-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.menu-label {
  min-width: 0;
}

.admin-sidebar-logout {
  margin-top: auto;
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(220, 53, 69, 0.16);
  color: white;
  font-size: var(--admin-menu-font-size);
  line-height: var(--admin-menu-line-height);
}

.admin-main {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  min-height: 68px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-topbar-left,
.admin-topbar-right,
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-topbar-actions {
  margin-left: auto;
  margin-right: 0;
}

.admin-sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

.admin-topbar-label {
  font-size: var(--admin-menu-label-size);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.admin-topbar h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 24px;
  color: #111827;
}

.admin-topbar-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef6fb;
  color: #1c5b77;
  font-size: 13px;
  font-weight: 600;
}

.admin-content {
  padding: 24px;
  display: grid;
  gap: 22px;
  flex: 1;
}

.app-footer {
  align-self: stretch;
  width: 100%;
  margin-top: auto;
  padding: 18px 24px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
}

.app-footer strong {
  color: #ffffff;
}

.admin-main > .app-footer {
  color: #64748b;
}

.admin-main > .app-footer strong {
  color: #334155;
}

.admin-hero-card {
  padding: 24px 26px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #3c8dbc 0%, #145374 100%);
  box-shadow: 0 14px 36px rgba(60, 141, 188, 0.22);
}

.admin-hero-kicker {
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.74);
}

.admin-hero-card h3 {
  font-size: 28px;
  margin-bottom: 8px;
}

.admin-hero-card p {
  max-width: 840px;
  color: rgba(255, 255, 255, 0.84);
}

.admin-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 22px 24px 0;
}

.admin-card-head h3 {
  font-size: 20px;
  color: #111827;
  margin-bottom: 4px;
}

.admin-card-head p {
  font-size: 13px;
  color: #6b7280;
}

.admin-action-grid {
  padding: 20px 24px 24px !important;
  background: transparent !important;
  border-bottom: 0 !important;
}

.admin-search-grid {
  padding: 20px 24px 24px !important;
  background: transparent !important;
  border-bottom: 0 !important;
}

.admin-pagination-bar {
  padding: 18px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pagination-summary {
  color: #6b7280;
  font-size: 14px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-actions button,
.admin-action-grid button,
.search-box button,
.training-admin-table td button {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.pagination-actions button::after,
.admin-action-grid button::after,
.search-box button::after,
.training-admin-table td button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.22) 35%, transparent 62%);
  transform: translateX(-140%);
  transition: transform 0.55s ease;
}

.pagination-actions button:hover::after,
.admin-action-grid button:hover::after,
.search-box button:hover::after,
.training-admin-table td button:hover::after {
  transform: translateX(140%);
}

.pagination-state {
  color: #111827;
  font-weight: 600;
}

.admin-table-wrap {
  padding: 20px 24px 24px;
  overflow-x: auto;
  max-height: min(72vh, 980px);
}

.admin-table {
  min-width: 1700px;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  box-shadow: inset 0 -1px 0 #dbe4f0;
  color: #0f172a;
  font-weight: 700;
}

.admin-table tbody tr:nth-child(even) td {
  background: #f9fbfd;
}

.admin-table tbody tr:hover td {
  background: #eef6ff;
}

.training-table-wrap {
  overflow: auto;
}

.training-admin-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.training-admin-table th,
.training-admin-table td {
  padding: 10px 8px;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.training-admin-table th {
  font-size: 11px;
  letter-spacing: 0.03em;
}

.training-admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, #1f4b99 0%, #145374 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.training-admin-table tbody tr:nth-child(even) td {
  background: #f9fbfd;
}

.training-admin-table tbody tr:hover td {
  background: #eef6ff;
}

.training-admin-table .col-id,
.training-admin-table .col-hours,
.training-admin-table .col-cost,
.training-admin-table .col-branch,
.training-admin-table .col-cert,
.training-admin-table .col-actions {
  text-align: center;
}

.training-admin-table .col-id { width: 4%; }
.training-admin-table .col-code { width: 7%; }
.training-admin-table .col-name { width: 11%; }
.training-admin-table .col-dept { width: 10%; }
.training-admin-table .col-branch { width: 6%; }
.training-admin-table .col-training { width: 15%; }
.training-admin-table .col-type { width: 8%; }
.training-admin-table .col-date { width: 7%; }
.training-admin-table .col-hours { width: 5%; }
.training-admin-table .col-cost { width: 6%; }
.training-admin-table .col-cert { width: 6%; }
.training-admin-table .col-updated-by { width: 7%; }
.training-admin-table .col-actions { width: 8%; }

.training-admin-table .col-cert a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.training-admin-table .col-cert div {
  gap: 2px !important;
}

.training-admin-table .col-cert span:first-child {
  font-size: 22px !important;
}

.training-admin-table .col-cert span:last-child {
  font-size: 9px !important;
}

.training-admin-table .col-updated-by {
  font-size: 11px;
  color: #666;
}

.training-admin-table th.col-updated-by {
  color: #fff;
}

.table-action-stack {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

body.training-modal-open {
  overflow: hidden;
}

.training-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.18s ease;
}

.training-modal.is-visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.training-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.training-modal-dialog {
  position: relative;
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 24px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.26);
  transform: translateY(18px) scale(0.985);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.training-modal.is-visible .training-modal-backdrop {
  opacity: 1;
}

.training-modal.is-visible .training-modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.training-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.training-modal-close {
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
}

.training-modal-close:hover {
  background: #e2e8f0;
}

.training-admin-table td button {
  width: 100%;
  margin: 0;
  padding: 5px 8px;
  font-size: 11px;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.training-admin-table td button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.14);
}

.admin-training-form {
  padding-top: 20px;
  margin: 0 24px 24px;
}

.btn-danger-soft {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%) !important;
}

.toast-message {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  z-index: 1300;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.toast-message.success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.toast-message.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.toast-message.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.table-skeleton-row td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.table-skeleton-bar {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0 0%, #f8fafc 50%, #e2e8f0 100%);
  background-size: 200% 100%;
  animation: tableSkeletonPulse 1.3s ease-in-out infinite;
}

.table-skeleton-bar.short {
  width: 52%;
}

.table-skeleton-bar.medium {
  width: 76%;
}

.empty-state-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  text-align: center;
}

.empty-state-icon {
  font-size: 28px;
  line-height: 1;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
}

.empty-state-copy {
  font-size: 13px;
  color: #64748b;
}

.table-empty-cell {
  padding: 28px 18px;
}

@keyframes tableSkeletonPulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.form-actions button:disabled,
.training-save-btn.is-loading {
  opacity: 0.7;
  cursor: wait;
  filter: saturate(0.85);
}

.required-mark {
  color: red;
}

.helper-text {
  color: #666;
  font-size: 12px;
}

.span-full {
  grid-column: 1 / -1;
}

.current-certificate {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.certificate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.certificate-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.certificate-link {
  color: #667eea;
  font-weight: 600;
}

.certificate-delete-btn {
  padding: 6px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .training-table-wrap {
    overflow-x: auto;
  }

  .training-admin-table {
    min-width: 1200px;
  }

  .admin-panel-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 280px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 40;
  }

  .admin-panel-shell.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .admin-content,
  .admin-topbar {
    padding: 18px 16px;
  }

  .admin-topbar,
  .admin-pagination-bar,
  .admin-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination-actions {
    flex-wrap: wrap;
  }

  .admin-action-grid,
  .admin-search-grid,
  .admin-table-wrap,
  .admin-training-form {
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin-left: 0;
    margin-right: 0;
  }

  .certificate-row,
  .certificate-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .training-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .training-modal-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 22px 22px 0 0;
  }
}
