/* ==========================================================================
   ระบบผลการปฏิบัติงานตามข้อตกลง PA - โรงเรียนโคกสีพิทยาสรรพ์
   สไตล์: Modern Minimal Vibrant (ทันสมัย มินิมอล สีสันสดใส)
   ========================================================================== */

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

:root {
  /* Color Palette - Vibrant & Friendly Modern Education (Royal Crimson / Ruby Theme) */
  --primary: #dc2626;            /* Red 600 */
  --primary-hover: #b91c1c;      /* Red 700 */
  --primary-light: #fee2e2;      /* Red 100 */
  --secondary: #ea580c;          /* Orange / Coral 600 */
  --secondary-hover: #c2410c;
  --secondary-light: #ffedd5;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-indigo: #6366f1;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #f43f5e 100%);
  --grad-hero: linear-gradient(135deg, #18080c 0%, #3f0713 50%, #881337 100%);
  --grad-vibrant: linear-gradient(135deg, #f43f5e 0%, #dc2626 50%, #f59e0b 100%);
  --grad-card-top: linear-gradient(90deg, #dc2626, #f43f5e);
  --grad-badge-exec: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-btn: linear-gradient(135deg, #dc2626 0%, #e11d48 100%);
  --grad-btn-exec: linear-gradient(135deg, #d97706 0%, #b45309 100%);

  /* Neutrals & Background */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-light: #e2e8f0;
  --border-card: rgba(226, 232, 240, 0.8);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #475569;
  --text-white: #ffffff;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 20px 30px -6px rgba(220, 38, 38, 0.25), 0 8px 12px -4px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 25px rgba(225, 29, 72, 0.35);

  /* Borders & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  background-color: #faf5f5;
  background-image: 
    radial-gradient(at 0% 0%, rgba(225, 29, 72, 0.05) 0px, transparent 45%),
    radial-gradient(at 100% 15%, rgba(220, 38, 38, 0.04) 0px, transparent 45%),
    radial-gradient(at 50% 100%, rgba(245, 158, 11, 0.03) 0px, transparent 55%),
    radial-gradient(rgba(220, 38, 38, 0.12) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px;
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-normal);
}

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

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ==========================================================================
   Header & Navbar (Glassmorphism)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  padding: 2px;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bounce);
}

.brand-wrapper:hover .brand-logo {
  transform: rotate(6deg) scale(1.05);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-title span {
  background: var(--grad-vibrant);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-sub);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-normal);
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(220, 38, 38, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-nav-teacher {
  background: var(--grad-primary);
  color: white;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  border: none;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-nav-teacher:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
  color: white;
}

.btn-nav-admin {
  background: #f1f5f9;
  color: var(--text-sub);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-normal);
}

.btn-nav-admin:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
}

/* ==========================================================================
   Hero Section & Page Hero (Vibrant, Dimensional & Textured)
   ========================================================================== */
.hero-section, .page-hero {
  position: relative;
  background: radial-gradient(circle at 85% 15%, rgba(225, 29, 72, 0.45) 0%, transparent 45%),
              radial-gradient(circle at 15% 85%, rgba(245, 158, 11, 0.25) 0%, transparent 40%),
              radial-gradient(circle at 50% 50%, rgba(220, 38, 38, 0.3) 0%, transparent 55%),
              linear-gradient(135deg, #1f0307 0%, #3e0513 35%, #700b21 70%, #991b1b 100%);
  color: white;
  padding: 4.5rem 1.25rem 4rem;
  overflow: hidden;
  border-bottom-left-radius: 36px;
  border-bottom-right-radius: 36px;
  box-shadow: 0 25px 50px -15px rgba(25, 3, 8, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(244, 63, 94, 0.25);
}

.page-hero {
  padding: 3.5rem 1.25rem 3rem;
  text-align: center;
}

/* Hero Decorative Pattern (Isometric Grid & Micro-Dots) */
.hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at center, rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px),
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 32px 32px;
  mask-image: radial-gradient(ellipse 90% 85% at 50% 45%, #000 35%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 45%, #000 35%, transparent 95%);
  opacity: 0.85;
  z-index: 1;
}

/* Floating Dimensional Celestial Rings */
.hero-shape-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.hero-shape-ring-1 {
  top: -90px;
  right: -70px;
  width: 440px;
  height: 440px;
  border: 1.5px dashed rgba(254, 205, 211, 0.22);
  animation: spinSlow 55s linear infinite;
}

.hero-shape-ring-2 {
  bottom: -130px;
  left: -90px;
  width: 500px;
  height: 500px;
  border: 1.5px solid rgba(245, 158, 11, 0.18);
  animation: spinSlowReverse 65s linear infinite;
}

/* Floating Ambient Light Spheres */
.hero-shape-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(65px);
  pointer-events: none;
  opacity: 0.55;
  z-index: 1;
}

.hero-shape-glow-1 {
  top: 5%;
  right: 12%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #f43f5e 0%, transparent 70%);
}

.hero-shape-glow-2 {
  bottom: 5%;
  left: 8%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, #ea580c 0%, transparent 70%);
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinSlowReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Hero Background Blobs */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

.hero-blob-1 {
  top: -10%;
  right: -5%;
  width: 380px;
  height: 380px;
  background: #dc2626;
}

.hero-blob-2 {
  bottom: -20%;
  left: 5%;
  width: 420px;
  height: 420px;
  background: #f43f5e;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  color: #fecdd3;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  animation: fadeInDown 0.6s ease-out;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-title-highlight {
  background: linear-gradient(135deg, #fca5a5 0%, #f43f5e 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 400;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Stats Counter Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

.stat-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 16px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: var(--transition-normal);
}

.stat-box:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-3px);
}

.stat-number {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #fee2e2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 400;
}

/* Search Bar in Hero */
.search-container {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  border: 2px solid transparent;
  transition: var(--transition-normal);
}

.search-input-wrapper:focus-within {
  border-color: #f87171;
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.25);
}

.search-icon {
  color: #94a3b8;
  font-size: 1.25rem;
  margin-right: 12px;
}

.search-input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  width: 100%;
  background: transparent;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-clear-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 1rem;
  display: none;
}

.search-clear-btn:hover {
  color: var(--accent-rose);
}

/* ==========================================================================
   Filter Pills & Controls
   ========================================================================== */
.filter-section {
  padding: 2.25rem 0 1rem;
}

.filter-pills-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.filter-pills-wrap::-webkit-scrollbar {
  height: 5px;
}

.filter-pills-wrap::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

.filter-pill {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: white;
  border: 1px solid var(--border-light);
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-sm);
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.filter-pill.active {
  background: var(--grad-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}

.pill-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-header-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.section-title-group {
  display: flex;
  flex-direction: column;
}

.section-tag {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 4px;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-normal);
}

.section-link:hover {
  color: var(--primary-hover);
  transform: translateX(4px);
}

/* ==========================================================================
   Staff Card Grid & Modern Card Design
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 24px;
  margin-bottom: 3.5rem;
}

/* Individual Card */
.staff-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-md);
  padding: 24px 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: default;
  transition: var(--transition-bounce);
}

.staff-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--grad-card-top);
  opacity: 0.85;
}

.staff-card.card-clickable {
  cursor: pointer;
}

.staff-card.card-clickable:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(220, 38, 38, 0.4);
}

/* Executive Card Specialty */
.staff-card.card-executive::before {
  background: var(--grad-badge-exec);
  height: 6px;
}

.staff-card.card-executive.card-clickable:hover {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 20px 30px -6px rgba(217, 119, 6, 0.22), 0 8px 12px -4px rgba(15, 23, 42, 0.08);
}

.card-top-badges {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.badge-role {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-sub);
}

.badge-role.executive {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-status.has-link {
  background: #dcfce7;
  color: #15803d;
}

.badge-status.no-link {
  background: #f1f5f9;
  color: #94a3b8;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Avatar Styling */
.card-avatar-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.card-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  background: #f8fafc;
  transition: var(--transition-bounce);
}

.staff-card.card-clickable:hover .card-avatar {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.25);
  border-color: #fee2e2;
}

.card-avatar-wrapper.executive .card-avatar {
  border: 4px solid #fef3c7;
}

/* Card Content Details */
.card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-position {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.card-executive .card-position {
  color: #d97706;
}

.card-standing {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-executive .card-standing {
  margin-bottom: 20px;
}

.card-dept {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-sub);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sleek Minimal Click Hint */
.card-click-hint {
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hint-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition-normal);
}

.staff-card.card-clickable:hover .hint-active {
  color: var(--primary-hover);
  transform: translateX(3px);
}

.card-executive .hint-active {
  color: #d97706;
}

.card-executive.card-clickable:hover .hint-active {
  color: #b45309;
}

.hint-disabled {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 400;
}

.btn-card-secondary:hover {
  color: var(--primary);
  background: #f1f5f9;
}

/* ==========================================================================
   Empty State & Not Found
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px dashed #cbd5e1;
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 3.5rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: #0f172a;
  color: #cbd5e1;
  padding: 3.5rem 1.25rem 2rem;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 2.5rem;
}

.footer-brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.footer-brand-desc {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 440px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.9rem;
  color: #94a3b8;
}

.footer-links a:hover {
  color: #f87171;
  padding-left: 4px;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
}

/* ==========================================================================
   Staff Login & Profile Form Styling
   ========================================================================== */
.auth-wrapper {
  min-height: calc(100vh - 250px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
}

.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--grad-primary);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--accent-rose);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  background: #ffffff;
  transition: var(--transition-normal);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.btn-submit {
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: white;
  background: var(--grad-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
  transition: var(--transition-bounce);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* Alert Notification */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* ==========================================================================
   Staff Profile Dashboard
   ========================================================================== */
.profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  margin: 2.5rem 0 4rem;
}

.panel-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}

.panel-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-upload-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px dashed #cbd5e1;
  margin-bottom: 1.5rem;
}

.avatar-upload-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Admin Tables & Back-office Styling
   ========================================================================== */
.admin-table-wrap {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  margin-bottom: 2rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.admin-table th {
  background: #f8fafc;
  color: var(--text-sub);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

.btn-action-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-normal);
}

.btn-edit {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-edit:hover {
  background: #bae6fd;
}

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-delete:hover {
  background: #fecaca;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-bounce);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border-light);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Department Modern Custom Dropdown
   ========================================================================== */
.dept-dropdown-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dept-dropdown-trigger {
  flex: 1;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  outline: none;
}

.dept-dropdown-trigger:hover {
  border-color: #f87171;
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.12);
  transform: translateY(-1px);
}

.dept-dropdown-wrapper.open .dept-dropdown-trigger {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.trigger-left {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.trigger-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.trigger-text-group {
  display: flex;
  flex-direction: column;
}

.trigger-sub {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trigger-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.trigger-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.trigger-badge {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid #fecaca;
}

.trigger-chevron {
  transition: transform 0.25s ease;
  color: #64748b;
}

.dept-dropdown-wrapper.open .trigger-chevron {
  transform: rotate(180deg);
  color: #dc2626;
}

.dept-reset-btn {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.08);
  font-family: inherit;
}

.dept-reset-btn:hover {
  background: #fecdd3;
  transform: translateY(-1px);
}

.dept-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.03);
  z-index: 1000;
  overflow-y: auto;
  max-height: 440px;
  padding: 8px;
  animation: dropdownPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPopIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dept-dropdown-item {
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 12px;
  margin-bottom: 3px;
  border: 1.5px solid transparent;
}

.dept-dropdown-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.dept-dropdown-item.active {
  background: #fef2f2;
  border-color: #fecaca;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.item-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.item-desc {
  font-size: 0.75rem;
  color: #64748b;
}

.item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.item-count-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
}

.item-check {
  display: none;
  color: #dc2626;
  font-weight: 800;
  font-size: 1.1rem;
}

.dept-dropdown-item.active .item-check {
  display: inline-block;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 6px 0;
}
