@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   APPLE DESIGN SYSTEM - CSS VARIABLES
   ============================================ */
:root {
  --apple-bg: #FBFBFD;
  --apple-card: #FFFFFF;
  --apple-blue: #0071E3;
  --apple-blue-hover: #0077ED;
  --apple-blue-light: rgba(0, 113, 227, 0.08);
  --apple-text: #1D1D1F;
  --apple-text-sec: #6E6E73;
  --apple-border: #D2D2D7;
  --apple-sidebar: #F5F5F7;
  --apple-success: #34C759;
  --apple-error: #FF3B30;
  --apple-warning: #FF9500;
  --apple-purple: #AF52DE;
  --apple-teal: #5AC8FA;
  --apple-pink: #FF2D55;
  --sidebar-width: 260px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 15px;
  color: var(--apple-text);
  background: var(--apple-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--apple-blue);
  text-decoration: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--apple-blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--apple-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--apple-text);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
}

.btn-danger {
  background: var(--apple-error);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #e0352b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--apple-blue);
  padding: 6px 12px;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--apple-blue-light);
}

.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--apple-text-sec);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(0,0,0,0.06);
  color: var(--apple-text);
}

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--apple-card);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
}

.card-sm {
  padding: 20px;
  border-radius: 14px;
}

/* ============================================
   FORM INPUTS
   ============================================ */
.input-field {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--apple-text);
  background: #fff;
  border: 1.5px solid var(--apple-border);
  border-radius: 10px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-field:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.input-field::placeholder {
  color: #AEAEB2;
}

.input-field[type="number"] {
  -moz-appearance: textfield;
}

.input-field[type="number"]::-webkit-outer-spin-button,
.input-field[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--apple-text);
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 18px;
}

.form-error {
  color: var(--apple-error);
  font-size: 12px;
  margin-top: 4px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 980px;
  letter-spacing: 0.02em;
}

.badge-planta {
  background: rgba(52, 199, 89, 0.12);
  color: #1a8c3e;
}

.badge-comodin {
  background: rgba(0, 113, 227, 0.1);
  color: var(--apple-blue);
}

.badge-error {
  background: rgba(255, 59, 48, 0.1);
  color: #c0392b;
}

.badge-warning {
  background: rgba(255, 149, 0, 0.12);
  color: #b36a00;
}

.badge-success {
  background: rgba(52, 199, 89, 0.12);
  color: #1a8c3e;
}

.badge-neutral {
  background: rgba(0,0,0,0.06);
  color: var(--apple-text-sec);
}

.badge-purple {
  background: rgba(175, 82, 222, 0.1);
  color: #8b3bb5;
}

/* ============================================
   TABLE
   ============================================ */
.apple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.apple-table thead tr {
  background: var(--apple-sidebar);
  border-bottom: 1px solid var(--apple-border);
}

.apple-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apple-text-sec);
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.apple-table thead th:first-child {
  border-radius: 10px 0 0 0;
}

.apple-table thead th:last-child {
  border-radius: 0 10px 0 0;
  text-align: right;
}

.apple-table tbody tr {
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background var(--transition);
}

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

.apple-table tbody tr:hover {
  background: rgba(0,0,0,0.015);
}

.apple-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.apple-table td:last-child {
  text-align: right;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--apple-sidebar);
  border-right: 1px solid var(--apple-border);
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 2px;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--apple-border);
}

.sidebar-logo-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--apple-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-school-name {
  font-size: 12px;
  color: var(--apple-text-sec);
  margin-top: 4px;
  font-weight: 400;
  padding-left: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--apple-text-sec);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 8px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: var(--apple-text);
  transition: all var(--transition);
  margin-bottom: 1px;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover {
  background: rgba(0,0,0,0.05);
}

.sidebar-item-active {
  background: #fff;
  font-weight: 600;
  color: var(--apple-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sidebar-item-active .sidebar-item-icon {
  color: var(--apple-blue);
}

.sidebar-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--apple-text-sec);
}

.sidebar-item-label {
  flex: 1;
}

.sidebar-badge {
  font-size: 10px;
  font-weight: 600;
  background: rgba(0,0,0,0.08);
  color: var(--apple-text-sec);
  padding: 2px 7px;
  border-radius: 980px;
  min-width: 20px;
  text-align: center;
}

.sidebar-item-active .sidebar-badge {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--apple-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--apple-text-sec);
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.15s ease;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slide-up 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.modal-box-lg {
  max-width: 720px;
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--apple-border);
  margin-top: 8px;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slide-in 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
  backdrop-filter: blur(10px);
}

.toast-success {
  background: rgba(52, 199, 89, 0.95);
  color: #fff;
}

.toast-error {
  background: rgba(255, 59, 48, 0.95);
  color: #fff;
}

.toast-warning {
  background: rgba(255, 149, 0, 0.95);
  color: #fff;
}

.toast-info {
  background: rgba(0, 113, 227, 0.95);
  color: #fff;
}

.toast-exit {
  animation: slide-out 0.25s ease forwards;
}

/* ============================================
   SKELETON LOADER
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

.skeleton-row {
  height: 48px;
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* ============================================
   HORARIO GRID
   ============================================ */
.horario-grid {
  display: grid;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--apple-border);
  font-size: 12px;
}

.horario-grid-header {
  background: var(--apple-sidebar);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--apple-text-sec);
  padding: 12px 10px;
  text-align: center;
}

.horario-cell {
  padding: 8px;
  border-right: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  cursor: default;
  transition: all var(--transition);
}

.horario-cell:hover {
  filter: brightness(0.96);
}

.horario-cell-label {
  background: var(--apple-sidebar);
  font-weight: 600;
  font-size: 11px;
  color: var(--apple-text-sec);
  display: flex;
  align-items: center;
  justify-content: center;
}

.horario-cell-materia {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.horario-cell-sub {
  font-size: 10px;
  color: rgba(0,0,0,0.5);
  line-height: 1.3;
}

.horario-cell-empty {
  opacity: 0.4;
}

/* ============================================
   TABS
   ============================================ */
.tabs-bar {
  display: flex;
  gap: 2px;
  background: var(--apple-sidebar);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}

.tab-btn {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--apple-text-sec);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  font-family: inherit;
}

.tab-btn-active {
  background: #fff;
  color: var(--apple-text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ============================================
   SECTION PAGE HEADER
   ============================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--apple-text);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   SEARCH INPUT
   ============================================ */
.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--apple-text-sec);
  pointer-events: none;
}

.search-input {
  padding-left: 36px;
  width: 220px;
  height: 36px;
  font-size: 14px;
}

/* ============================================
   PENSUM MATRIX
   ============================================ */
.pensum-table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}

.pensum-table th, .pensum-table td {
  border: 1px solid var(--apple-border);
  padding: 8px 10px;
  text-align: center;
}

.pensum-table th {
  background: var(--apple-sidebar);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-text-sec);
  white-space: nowrap;
}

.pensum-table td:first-child {
  text-align: left;
  font-weight: 500;
  background: var(--apple-sidebar);
  min-width: 120px;
}

.pensum-input {
  width: 60px;
  border: 1px solid transparent;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  padding: 4px;
  transition: all var(--transition);
  color: var(--apple-text);
}

.pensum-input:focus {
  border-color: var(--apple-blue);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.15);
}

.pensum-input::placeholder {
  color: #C7C7CC;
}

/* ============================================
   DISPONIBILIDAD MATRIX
   ============================================ */
.disp-table {
  border-collapse: collapse;
  font-size: 13px;
}

.disp-table th {
  background: var(--apple-sidebar);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-text-sec);
  padding: 10px 14px;
  border: 1px solid var(--apple-border);
  white-space: nowrap;
}

.disp-table td {
  border: 1px solid var(--apple-border);
  padding: 10px;
  text-align: center;
}

.disp-table td:first-child {
  text-align: left;
  font-weight: 500;
  background: var(--apple-sidebar);
  padding: 10px 14px;
  white-space: nowrap;
}

.disp-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--apple-blue);
}

/* ============================================
   VALIDAR / GENERAR
   ============================================ */
.issue-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.issue-row:last-child {
  border-bottom: none;
}

.issue-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.issue-ok .issue-icon { color: var(--apple-success); }
.issue-error .issue-icon { color: var(--apple-error); }
.issue-warning .issue-icon { color: var(--apple-warning); }

.progress-bar-outer {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: var(--apple-blue);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.metric-card {
  background: var(--apple-sidebar);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--apple-text);
  line-height: 1;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 12px;
  color: var(--apple-text-sec);
}

/* ============================================
   CSV PREVIEW
   ============================================ */
.csv-preview {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--apple-border);
}

.csv-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.csv-preview th {
  background: var(--apple-sidebar);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-text-sec);
  white-space: nowrap;
  text-align: left;
}

.csv-preview td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  white-space: nowrap;
}

.csv-preview tr:last-child td {
  border-bottom: none;
}

/* ============================================
   GENERATE BIG BUTTON
   ============================================ */
.generate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0071E3, #0055b3);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 113, 227, 0.4);
  gap: 8px;
}

.generate-btn:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 12px 40px rgba(0, 113, 227, 0.5);
}

.generate-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.generate-btn.running {
  animation: pulse-blue 1.5s infinite;
}

/* ============================================
   HISTORIA CARD
   ============================================ */
.horario-hist-card {
  background: var(--apple-card);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--apple-border);
  transition: all var(--transition);
}

.horario-hist-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* ============================================
   SLIDER
   ============================================ */
.apple-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--apple-border);
  border-radius: 2px;
  outline: none;
}

.apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--apple-blue);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

.apple-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--apple-blue);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

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

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--apple-text);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--apple-text-sec);
}

/* ============================================
   LAYOUT
   ============================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--apple-bg);
}

.section-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 32px;
}

/* ============================================
   RADIO BUTTONS
   ============================================ */
.radio-group {
  display: flex;
  gap: 16px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.radio-option input[type="radio"] {
  accent-color: var(--apple-blue);
  width: 16px;
  height: 16px;
}

/* ============================================
   CHECKBOX
   ============================================ */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background var(--transition);
}

.checkbox-item:hover {
  background: var(--apple-sidebar);
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--apple-blue);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes pulse-blue {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 113, 227, 0.4); }
  50% { box-shadow: 0 8px 48px rgba(0, 113, 227, 0.7); }
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

/* ============================================
   CONFIRM MODAL
   ============================================ */
.confirm-modal-box {
  max-width: 380px;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.upload-zone {
  border: 2px dashed var(--apple-border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--apple-sidebar);
}

.upload-zone:hover {
  border-color: var(--apple-blue);
  background: var(--apple-blue-light);
}

.upload-zone.has-file {
  border-color: var(--apple-success);
  background: rgba(52, 199, 89, 0.05);
}

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

  .page-title {
    font-size: 18px;
  }

  .sidebar {
    display: none;
  }

  .modal-box {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* ============================================
   SCROLLBAR GLOBAL
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

/* ============================================
   MISC UTILITIES
   ============================================ */
.text-sec { color: var(--apple-text-sec); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.overflow-x-auto { overflow-x: auto; }
.hidden { display: none; }
[x-cloak] { display: none !important; }
