/* ==============================
   ระบบบันทึกความดี - Main Styles
   วิทยาลัยพยาบาลทหารอากาศ
   ============================== */

/* Fonts imported in HTML head to fix iOS loading issues */

/* ===== EXECUTIVE LEADERSHIP BADGE ON CARD ===== */
.executive-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #c9a227 0%, #b8860b 50%, #8b6508 100%);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  letter-spacing: 0.2px;
  margin-top: 3px;
  margin-bottom: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  animation: execBadgePulse 3s ease-in-out infinite;
}

@keyframes execBadgePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(201, 162, 39, 0.4); }
  50% { box-shadow: 0 4px 14px rgba(201, 162, 39, 0.7); }
}

:root {
  /* Core Colors */
  --navy: #0a1628;
  --navy-mid: #0e1f3d;
  --navy-light: #142952;
  --navy-border: rgba(30, 58, 110, 0.6);
  --gold: #c9a227;
  --gold-light: #e8c44a;
  --gold-dark: #a07818;
  --gold-bg: rgba(201, 162, 39, 0.1);

  /* Status Colors */
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);

  /* Text */
  --text-primary: #f0f4ff;
  --text-secondary: #93a9c8;
  --text-muted: #5a738a;

  /* UI */
  --card-bg: rgba(14, 31, 61, 0.35);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(10, 22, 40, 0.6);
  --hover-bg: rgba(201, 162, 39, 0.08);

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 0 24px rgba(201, 162, 39, 0.15);

  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', "Sukhumvit Set", "Thonburi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background: radial-gradient(at 0% 0%, #0a1428 0%, #050a12 100%),
              radial-gradient(at 100% 0%, rgba(201, 162, 39, 0.16) 0%, transparent 50%),
              radial-gradient(at 50% 100%, rgba(59, 130, 246, 0.1) 0%, transparent 60%),
              radial-gradient(at 80% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4 {
  font-family: 'Kanit', "Sukhumvit Set", "Thonburi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.3;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

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

p {
  color: var(--text-secondary);
}

.text-gold {
  color: var(--gold);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-yellow {
  color: var(--yellow);
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.font-bold {
  font-weight: 700;
}

/* ===== NAV / HEADER ===== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a1628;
  border-bottom: 1px solid var(--navy-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

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

.nav-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
}

.nav-brand-text .title {
  font-family: 'Kanit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.2;
}

.nav-brand-text .subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.nav-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--navy);
}

/* ===== SIDEBAR (Off-canvas Slide) ===== */
.layout {
  display: flex;
  min-height: calc(100vh - 64px);
  position: relative;
}

/* Hamburger toggle button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--navy-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--hover-bg);
  color: var(--gold);
  border-color: var(--gold);
}

/* Sidebar panel */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 270px;
  height: 100vh;
  background: #0a1628;
  border-right: 1px solid var(--navy-border);
  padding: 0;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.6);
}

/* Sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--navy-border);
  flex-shrink: 0;
}

.sidebar-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header .brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
}

.sidebar-header .brand-text {
  font-family: 'Kanit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.3;
}

.sidebar-header .brand-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Sarabun', sans-serif;
  font-weight: 400;
}

.sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.sidebar-close:hover {
  background: var(--red-bg);
  color: var(--red);
}

/* Sidebar menu items */
.sidebar-menu {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 12px 18px 4px;
}

.sidebar-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  position: relative;
}

.sidebar-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-item.active {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.2);
  font-weight: 600;
}

.sidebar-item .icon {
  width: 20px;
  font-size: 1.05rem;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--navy-border);
  flex-shrink: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  overflow-x: hidden;
}


/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: rgba(201, 162, 39, 0.2);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  transform: translateY(-2px);
}

.crystal-card {
  background: rgba(14, 31, 61, 0.45);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.crystal-card:hover {
  border-color: rgba(201, 162, 39, 0.3);
  box-shadow: 0 16px 48px 0 rgba(0, 0, 0, 0.5), 0 0 24px rgba(201, 162, 39, 0.2);
  transform: translateY(-2px);
}

.card-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  color: var(--gold);
}

.card-gold {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), rgba(160, 120, 24, 0.05));
  border-color: rgba(201, 162, 39, 0.3);
  box-shadow: var(--shadow-gold);
}

/* ===== STAT BOXES ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
}

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

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: 'Kanit', sans-serif;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.4);
}

.progress-fill.green {
  background: linear-gradient(90deg, #16a34a, #22c55e);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.progress-fill.red {
  background: linear-gradient(90deg, #dc2626, #ef4444);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ===== BADGES / TAGS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: var(--yellow-bg);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-approved {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-rejected {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-gold {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.badge-blue {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Sarabun', "Sukhumvit Set", "Thonburi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--navy);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--navy-border);
}

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

.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}

.btn-success:hover {
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

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

.form-label .required {
  color: var(--red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  font-family: 'Sarabun', "Sukhumvit Set", "Thonburi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  transition: all 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
  background: #0a1628;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select option {
  background: var(--navy-mid);
}

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

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

.form-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 4px;
  display: none;
}

.form-error.show {
  display: block;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--navy-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--input-bg);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.upload-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gold);
}

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
}

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

thead {
  background: #0a1628;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--navy-border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(30, 58, 110, 0.3);
  transition: background 0.15s;
}

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

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

tbody td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

tbody td.id-cell {
  font-family: monospace;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== PILLS / FILTERS ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--navy-border);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  background: transparent;
  font-family: 'Sarabun', "Sukhumvit Set", "Thonburi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.filter-pill:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: var(--gold);
}

.filter-search {
  flex: 1;
  min-width: 200px;
}

/* ===== CATEGORY CHIPS ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.category-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.category-item:hover {
  border-color: var(--gold);
}

.category-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.category-info .name {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
}

.category-info .hours {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--navy-mid);
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s;
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--navy-mid);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideIn 0.3s ease;
  font-size: 0.875rem;
}

.toast.success {
  border-color: var(--green);
}

.toast.error {
  border-color: var(--red);
}

.toast.warning {
  border-color: var(--yellow);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== UTILS ===== */
.divider {
  height: 1px;
  background: var(--navy-border);
  margin: 20px 0;
}

.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 4px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }

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

  .top-nav {
    padding: 0 12px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .sidebar {
    width: 85vw;
    max-width: 300px;
  }
}


/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--navy-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

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

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ===== PREMIUM DYNAMIC ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(201, 162, 39, 0.2); }
  50% { box-shadow: 0 0 35px rgba(201, 162, 39, 0.5); }
}

.float-emoji {
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

/* ===== macOS TRAFFIC LIGHTS ===== */
.mac-traffic-lights {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.mac-traffic-lights .light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.mac-traffic-lights .red { background: #ff5f56; }
.mac-traffic-lights .yellow { background: #ffbd2e; }
.mac-traffic-lights .green { background: #27c93f; }

.mac-traffic-lights .mac-title {
  margin-left: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE SUITE: MOBILE (iPhone/Android/LIFF), IPAD, DESKTOP
   ========================================================================== */

/* Universal Safe Area & iOS Zoom Prevention */
input, select, textarea {
  font-size: 16px; /* Prevents auto-zoom on iOS Safari and LINE LIFF browser */
}

/* Global Container Constraints */
.layout, .container, .page-wrapper {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

/* Mobile Devices (< 640px) - iPhone, Android, LINE In-App Browser */
@media (max-width: 639px) {
  body {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .top-nav {
    height: 56px;
    padding: 0 12px;
  }

  .nav-brand span:not(.logo-text), .brand-sub {
    display: none;
  }

  .main-content {
    padding: 12px 10px;
  }

  h1 {
    font-size: 1.25rem !important;
  }

  h2 {
    font-size: 1.1rem !important;
  }

  /* Compact KPI grid on narrow mobile */
  .kpi-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .kpi-card {
    padding: 12px 10px !important;
  }

  .kpi-card .kpi-num {
    font-size: 1.4rem !important;
  }

  .kpi-card .kpi-label {
    font-size: 0.72rem !important;
  }

  /* Touch Target minimums for mobile thumbs */
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .form-actions {
    flex-direction: column;
    gap: 8px;
  }

  .form-actions .btn {
    width: 100% !important;
  }

  /* Table Horizontal Scrolling with Touch Momentum */
  .table-responsive, .table-container, .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modals & Dialogs on Mobile */
  .modal-dialog, .modal-content, [id$="-modal"] > div {
    max-width: calc(100vw - 20px) !important;
    padding: 16px 12px !important;
    border-radius: 16px !important;
  }

  /* Filter Toolbar */
  .filter-toolbar, .toolbar-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .filter-search {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }
}

/* Tablets & iPad (640px - 1024px) */
@media (min-width: 640px) and (max-width: 1024px) {
  .main-content {
    padding: 20px 16px;
  }

  .kpi-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .top-nav {
    padding: 0 20px;
  }

  .sidebar {
    width: 320px;
  }

  .table-responsive, .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Computers & Large Screens (> 1024px) */
@media (min-width: 1025px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
  }

  .main-content {
    padding: 28px 32px;
  }
}