/* ─── COUTURE CALENDAR ─── */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #FDFCFA;
  --surface: #fff;
  --surface-alt: #F9F7F4;
  --surface-warm: #F8F6F3;
  --border: #E8E4DF;
  --border-light: #F0ECE6;
  --text: #1A1A2E;
  --text-muted: #9C8FB0;
  --text-dim: #A09CAB;
  --text-faint: #D4D0DE;
  --gold: #D4AF37;
  --gold-bg: rgba(212,175,55,0.06);
  --navy: #1A1A2E;
  --purple: #6B5CE7;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  --green: #166534;
  --green-bg: #F0FDF4;
  --green-border: #BBF7D0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(0,0,0,0.03), 0 6px 24px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --font-display: 'Newsreader', Georgia, serif;
  --font-ui: 'Outfit', system-ui, sans-serif;
  --transition: 0.15s ease;
}

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

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── LAYOUT ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 36px 28px 60px; }

/* ─── HEADER ─── */
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; flex-wrap: wrap; gap: 20px; }
.header-left { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #3D3556);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 22px; font-weight: 600;
  font-family: var(--font-display);
  box-shadow: 0 2px 12px rgba(26,26,46,0.15);
  flex-shrink: 0;
}
.logo-img {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 12px rgba(26,26,46,0.15);
  flex-shrink: 0;
}
.header h1 {
  font-size: 30px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--text); line-height: 1;
}
.header .subtitle {
  margin-top: 5px; font-family: var(--font-ui); font-size: 10px;
  font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
}
.header .date-range {
  margin-top: 10px; font-family: var(--font-ui); font-size: 11px; color: var(--text-dim);
}
.shift-badge {
  color: var(--gold); margin-left: 10px; font-weight: 700;
}

/* ─── STATS ─── */
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-card {
  padding: 10px 18px; border-radius: 12px; font-family: var(--font-ui);
  text-align: center; min-width: 60px; border: 1px solid;
}
.stat-card .num { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-card .label {
  font-size: 9px; font-weight: 600; opacity: 0.7;
  text-transform: uppercase; letter-spacing: 0.08em; margin-top: 3px;
}

/* ─── ACTION BAR ─── */
.action-bar {
  display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; align-items: center;
  padding: 14px 18px; border-radius: var(--radius); background: var(--surface-warm);
  border: 1px solid #EBE6DF;
}
.action-label {
  font-family: var(--font-ui); font-size: 9px; font-weight: 700;
  color: #B5B0C0; text-transform: uppercase; letter-spacing: 0.12em; margin-right: 2px;
}
.action-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.btn {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all var(--transition); letter-spacing: 0.01em;
  border: 1px solid var(--text-faint); background: var(--surface); color: #4A3F5C;
}
.btn:hover { background: #F5F0EB; }
.btn-accent {
  border-color: var(--gold); background: var(--gold-bg); color: var(--navy);
}
.btn-accent:hover { background: var(--navy); color: var(--gold); }
.btn-subtle { border-color: #E0DBD4; background: transparent; color: var(--text-dim); }
.btn-subtle:hover { background: var(--surface-warm); }
.btn-danger { border-color: var(--red-border); background: var(--red-bg); color: var(--red); }
.btn-primary {
  border: none; background: var(--navy); color: var(--gold);
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.9; }
.btn .icon { font-size: 13px; }

/* ─── TABLE ─── */
.table-wrap {
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow);
  transition: opacity 0.3s;
}
.table-wrap.sorting { opacity: 0.4; }

.table-header {
  display: grid; grid-template-columns: 50px 36px 96px 1fr 120px 170px 42px;
  padding: 0 20px; height: 46px; align-items: center; background: var(--navy);
}
.table-header span {
  font-family: var(--font-ui); font-size: 10px; font-weight: 700;
  color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em;
}

.table-row {
  display: grid; grid-template-columns: 50px 36px 96px 1fr 120px 170px 42px;
  padding: 0 20px; min-height: 58px; align-items: center;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}
.table-row:hover { background: var(--surface-alt) !important; }
.table-row.abandoned { opacity: 0.5; }
.table-row.abandoned:hover { opacity: 0.65; }

.row-num {
  font-family: var(--font-ui); font-size: 11px; color: #B5B0C0;
  text-align: center; font-weight: 500;
}
.row-date {
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  color: var(--text); line-height: 1.2;
}
.row-day { font-family: var(--font-ui); font-size: 10px; color: var(--text-dim); font-weight: 500; }
.row-title {
  font-size: 14px; font-weight: 400; color: #2A2640;
  line-height: 1.4; padding: 12px 14px 12px 0; cursor: pointer;
  transition: color var(--transition);
}
.row-title:hover { color: var(--purple); }
.abandoned .row-title,
.abandoned .row-date { color: #B91C1C !important; text-decoration: line-through; font-style: italic; }

/* ─── LINKS ─── */
.link-pills { display: flex; gap: 6px; align-items: center; }
.link-pill {
  padding: 3px 8px; border-radius: 6px; border: none;
  font-family: var(--font-ui); font-size: 10px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 3px;
  transition: all var(--transition);
}
.link-pill.has-link { background: var(--green-bg); color: var(--green); }
.link-pill.no-link { background: var(--surface-warm); color: var(--text-muted); }
.link-pill.dim { opacity: 0.4; cursor: default; }

/* ─── STATUS SELECT ─── */
.status-select {
  appearance: none; -webkit-appearance: none; width: 100%;
  padding: 6px 26px 6px 10px; border-radius: 8px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  cursor: pointer; outline: none; transition: all var(--transition);
  background-repeat: no-repeat; background-position: right 8px center;
  background-size: 10px;
}
.status-select:focus { box-shadow: 0 0 0 2px rgba(212,175,55,0.2); }

/* ─── MOVE BUTTONS ─── */
.move-btns {
  display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center;
}
.move-btn {
  width: 22px; height: 16px; border: none; border-radius: 4px;
  background: transparent; color: var(--text-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; transition: all var(--transition); opacity: 0;
  padding: 0; line-height: 1;
}
.move-btn span { font-size: 8px; }
.table-row:hover .move-btn { opacity: 0.6; }
.table-row:hover .move-btn:hover:not(:disabled) {
  opacity: 1; background: var(--surface-warm); color: var(--navy);
}
.move-btn:disabled { cursor: default; opacity: 0 !important; }
.table-row:hover .move-btn:disabled { opacity: 0.15 !important; }

/* ─── ABANDON BTN ─── */
.abandon-btn {
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-faint); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); opacity: 0.3;
}
.table-row:hover .abandon-btn { opacity: 1; color: var(--red); }
.abandon-btn.active {
  opacity: 1; border-color: var(--red-border);
  background: var(--red-bg); color: var(--red);
}

/* ─── LEGEND ─── */
.legend {
  margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  font-family: var(--font-ui); font-size: 10px;
}
.legend-label {
  font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.1em; margin-right: 4px;
}
.legend-item { display: flex; align-items: center; gap: 3px; color: #8C8399; }
.legend-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.legend-sep { color: var(--text-faint); margin-left: 2px; }

/* ─── MODAL OVERLAY ─── */
.overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,0.3);
  backdrop-filter: blur(2px); z-index: 50; animation: fadeIn 0.2s ease;
}
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: var(--bg); border-radius: 18px; box-shadow: var(--shadow-lg);
  z-index: 51; animation: modalIn 0.25s cubic-bezier(0.16,1,0.3,1);
  max-width: 92vw; overflow: hidden;
}
.modal-header {
  padding: 24px 28px 16px; border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 20px; font-weight: 500; }
.modal-body { padding: 20px 28px; }
.modal-footer {
  padding: 16px 28px 24px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ─── SIDE PANEL ─── */
.panel-wrap {
  position: fixed; top: 0; right: 0; width: 420px; max-width: 90vw;
  height: 100vh; background: var(--bg); border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.08); z-index: 51;
  animation: slideIn 0.25s cubic-bezier(0.16,1,0.3,1);
  display: flex; flex-direction: column;
}
.panel-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.panel-tabs { display: flex; gap: 0; margin-top: 16px; }
.panel-tab {
  padding: 8px 16px; border: none; border-bottom: 2px solid transparent;
  background: none; font-family: var(--font-ui); font-size: 12px;
  font-weight: 500; color: var(--text-dim); cursor: pointer;
  text-transform: capitalize; letter-spacing: 0.04em; transition: all var(--transition);
}
.panel-tab.active { font-weight: 700; color: var(--text); border-bottom-color: var(--gold); }
.panel-body { flex: 1; overflow: auto; padding: 20px 24px; }
.panel-footer {
  padding: 14px 24px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: space-between; flex-shrink: 0;
}

/* ─── FORM ELEMENTS ─── */
.field-label {
  display: block; font-family: var(--font-ui); font-size: 11px;
  font-weight: 600; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 8px;
}
.field-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-warm);
  font-family: var(--font-ui); font-size: 13px; color: var(--text);
  outline: none; transition: border-color var(--transition);
}
.field-input:focus { border-color: var(--gold); }
.field-textarea {
  width: 100%; min-height: 200px; padding: 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-warm);
  font-family: var(--font-display); font-size: 14px; color: var(--text);
  outline: none; resize: vertical; line-height: 1.6;
}
.field-textarea:focus { border-color: var(--gold); }
.field-select {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-warm);
  font-family: var(--font-ui); font-size: 13px; color: var(--text);
  outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2.5 4l2.5 2.5 2.5-2.5' stroke='%239C8FB0' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* ─── STATUS TAG ─── */
.status-tag {
  display: inline-block; padding: 4px 12px; border-radius: 6px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600;
}

/* ─── IMPORT PREVIEW ─── */
.import-preview {
  border-radius: 10px; border: 1px solid var(--border); overflow: hidden;
}
.import-preview-header {
  display: grid; grid-template-columns: 100px 1fr 120px;
  padding: 8px 14px; background: var(--surface-warm); gap: 8px;
}
.import-preview-row {
  display: grid; grid-template-columns: 100px 1fr 120px;
  padding: 10px 14px; border-top: 1px solid var(--border-light);
  gap: 8px; align-items: center;
}
.import-warning {
  padding: 8px 12px; border-radius: 8px; background: var(--red-bg);
  border: 1px solid var(--red-border); margin-bottom: 12px;
  font-family: var(--font-ui); font-size: 11px; color: #991B1B; font-weight: 500;
}

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  padding: 10px 24px; border-radius: 10px;
  background: var(--navy); color: var(--gold);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1);
  z-index: 100;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  padding: 40px; text-align: center; font-family: var(--font-ui); color: var(--text-dim);
}

/* ─── LOADING ─── */
.loading {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); color: var(--text-muted);
}

/* ─── FILE INPUT ─── */
.file-input { display: none; }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%,-50%) scale(0.95); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .container { padding: 20px 16px 40px; }
  .header { flex-direction: column; }
  .header h1 { font-size: 24px; }
  .table-header, .table-row {
    grid-template-columns: 30px 28px 70px 1fr 100px 42px;
  }
  .table-header span:nth-child(5),
  .table-row > *:nth-child(5) { display: none; }
  .action-bar { padding: 10px 12px; gap: 6px; }
  .btn { padding: 6px 10px; font-size: 11px; }
  .panel-wrap { width: 100%; max-width: 100vw; }
}
