/* ===== LỊCH CÔNG VIỆC — WARM EDITORIAL & PAPER AESTHETIC ===== */
  :root {
    --bg: #FAF7F2;
    --bg2: #FFFFFF;
    --bg3: #F2EFE8;
    --border: rgba(45, 38, 30, 0.10);
    --border-dark: rgba(45, 38, 30, 0.22);
    --silver: #24201A;
    --silver-dim: #7A7266;
    --text: #24201A;
    --text-dim: #7A7266;
    --accent: #BA4A1B;
    --accent-rgb: 186, 74, 27;
    --accent-hover: #9E3A11;
    --green: #15803d;
    --green-bg: rgba(21, 128, 61, 0.12);
    --blue: #0284c7;
    --red: #b91c1c;
    --amber: #b45309;
    --shadow: 0 4px 16px rgba(45, 38, 30, 0.05);
    --shadow-lg: 0 14px 40px rgba(45, 38, 30, 0.09);
    --radius: 12px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  body {
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    background-image:
      radial-gradient(circle at 20% 30%, rgba(45,38,30,0.02) 0%, transparent 40%),
      radial-gradient(circle at 80% 70%, rgba(45,38,30,0.015) 0%, transparent 40%),
      linear-gradient(rgba(45,38,30,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(45,38,30,0.025) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    color: var(--text);
    min-height: 100vh;
    padding: 24px;
    -webkit-font-smoothing: antialiased;
  }

  .container { max-width: 1280px; margin: 0 auto; }

  /* ===== Header ===== */
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
  }

  .header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }

  .btn-back-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(45, 38, 30, 0.04);
  }
  .btn-back-portfolio:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(186, 74, 27, 0.08);
    transform: translateX(-2px);
  }

  h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--silver);
    text-transform: none;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .stats { display: flex; gap: 12px; flex-wrap: wrap; }

  .stat-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    text-align: center;
    min-width: 80px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .stat-card .num { font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1.2; }
  .stat-card .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

  .stat-card.stat-btn {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  .stat-card.stat-btn:hover {
    border-color: var(--accent);
    background: rgba(186, 74, 27, 0.06);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 38, 30, 0.08);
  }

  .stat-card.stat-btn.btn-del-all:hover {
    border-color: #ef4444;
    background: #fef2f2;
    color: #b91c1c;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.12);
  }

  .stat-card.stat-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
  }

  /* ===== Main 2-Column Layout ===== */
  .layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
  }

  @media (max-width: 960px) {
    .layout { grid-template-columns: 1fr; }
  }

  .panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
  }

  /* ===== Calendar header ===== */
  .cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cal-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--silver);
    letter-spacing: -0.02em;
  }

  .cal-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

  button {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  button:hover {
    border-color: var(--accent);
    background: rgba(186, 74, 27, 0.08);
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(45, 38, 30, 0.06);
  }

  /* ===== Calendar grid ===== */
  .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 8px;
  }

  .weekday {
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding: 6px 0;
    font-weight: 600;
  }

  .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }

  /* Ô Ngày Tháng */
  .day {
    aspect-ratio: 1;
    min-height: 64px;
    background: #FAF8F4;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 7px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
  }

  .day:hover {
    border-color: var(--accent);
    background: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 38, 30, 0.08);
  }

  .day.has-bg-img {
    text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 2px 6px rgba(0,0,0,0.8);
  }

  .day.empty { background: transparent; border-color: transparent; cursor: default; }
  .day.empty:hover { transform: none; box-shadow: none; }

  .day-top-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    z-index: 2;
  }

  .day .d-num {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }

  .day .lunar-num {
    font-size: 10px;
    color: var(--silver-dim);
    font-weight: 500;
  }

  .day.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 2px 10px rgba(186, 74, 27, 0.2);
    background: #FFFDF9;
  }
  .day.today .d-num {
    color: var(--accent);
    font-weight: 800;
  }
  .day.selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(186, 74, 27, 0.25) !important;
    background: #FFFDF9 !important;
  }

  /* Nhãn Ngày Lễ Tết */
  .holiday-badge {
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    background: rgba(185, 28, 28, 0.9);
    border: 1px solid #dc2626;
    border-radius: 4px;
    padding: 1px 4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }

  .day.is-holiday {
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
    background-image: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.55)), url('./vietnam-flag.jpg');
    background-size: cover;
    background-position: center;
  }

  .day.is-holiday .d-num {
    color: #fff !important;
    font-weight: 800;
    text-shadow: 0 1px 4px #000;
  }

  .day.is-holiday .lunar-num {
    color: #fef08a !important;
    font-weight: 600;
    text-shadow: 0 1px 3px #000;
  }

  .day .dots { display: flex; gap: 3px; margin-top: auto; flex-wrap: wrap; z-index: 2; }
  .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--silver-dim);
  }
  .dot.high { background: #ef4444; }
  .dot.done { background: #15803d; }

  /* ===== Color & Image Picker Tool ===== */
  .color-picker-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }

  .color-picker-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 2px;
  }

  .color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  }
  .color-dot:hover {
    transform: scale(1.2);
    border-color: var(--silver);
  }

  .color-input-custom {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    padding: 0;
  }

  .btn-img-picker {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
    margin-left: auto;
    font-weight: 600;
  }
  .btn-img-picker:hover {
    border-color: var(--accent);
    background: rgba(186, 74, 27, 0.08);
  }

  /* Floating Context Menu */
  .context-color-menu {
    position: fixed;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    gap: 8px;
  }
  .context-color-menu.active { display: flex; }
  .context-color-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--silver);
  }
  .context-dots-row {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  /* ===== Task Panel ===== */
  .task-panel h2 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--silver);
    margin-bottom: 4px;
    font-weight: 700;
  }

  .task-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-date { font-size: 13px; color: var(--text-dim); }

  .add-form-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
  }

  .add-form-side input, .add-form-side select {
    background: #FAF8F4;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
  }

  .add-form-side input:focus, .add-form-side select:focus {
    border-color: var(--accent);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(186, 74, 27, 0.10);
  }
  .add-form-side select option { background: var(--bg2); color: var(--text); }

  .btn-add {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    border: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 13px;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(186, 74, 27, 0.22);
  }
  .btn-add:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(186, 74, 27, 0.32);
  }

  .btn-view-24h {
    width: 100%;
    margin-top: 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    padding: 9px;
    border-radius: 8px;
  }
  .btn-view-24h:hover {
    background: rgba(186, 74, 27, 0.08);
    border-color: var(--accent);
    color: var(--accent);
  }

  .task-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
  .task-list::-webkit-scrollbar { width: 5px; }
  .task-list::-webkit-scrollbar-track { background: var(--bg3); border-radius: 3px; }
  .task-list::-webkit-scrollbar-thumb { background: #D5CEC2; border-radius: 3px; }

  .task {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FAF8F4;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    animation: slideIn 0.25s ease;
    transition: all 0.2s;
  }

  @keyframes slideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
  }

  .task:hover {
    border-color: rgba(186, 74, 27, 0.3);
    background: #FFFFFF;
    box-shadow: 0 3px 10px rgba(45, 38, 30, 0.04);
  }

  .task input[type="checkbox"] {
    appearance: none;
    width: 20px; height: 20px;
    border: 2px solid #C4BEB4;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
    background: #FFFFFF;
  }

  .task input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
  }

  .task input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
  }

  .task-info { flex: 1; min-width: 0; }
  .task-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
  .task.done .task-title { text-decoration: line-through; color: var(--text-dim); }

  .task-meta { display: flex; gap: 8px; margin-top: 3px; align-items: center; }
  .task-time { font-size: 11px; color: var(--silver-dim); }
  .task-priority {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid;
    letter-spacing: 0.5px;
    font-weight: 600;
  }
  .p-high { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
  .p-medium { color: #b45309; border-color: #fde68a; background: #fffbeb; }
  .p-low { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }

  .btn-del {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
  }
  .btn-del:hover { color: #ef4444; background: #fef2f2; box-shadow: none; }

  .empty-tasks { text-align: center; color: var(--text-dim); font-size: 13px; padding: 24px 0; font-style: italic; }

  footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-dim); letter-spacing: 0.5px; }

  /* ===== 24H TIMELINE POPUP ===== */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(35, 30, 25, 0.45);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9990;
    padding: 16px;
    animation: fadeIn 0.2s ease;
  }
  .modal-overlay.active { display: flex; }

  #dayImageModal, #editTaskModal, #excelModal, #deleteModal {
    z-index: 10050 !important;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
  }

  .timeline-modal-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 860px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }

  .timeline-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #FAF8F4;
    flex-wrap: wrap;
    gap: 12px;
  }

  .timeline-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--silver);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .timeline-modal-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .timeline-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
  }

  .timeline-modal-body::-webkit-scrollbar { width: 5px; }
  .timeline-modal-body::-webkit-scrollbar-track { background: var(--bg3); border-radius: 3px; }
  .timeline-modal-body::-webkit-scrollbar-thumb { background: #D5CEC2; border-radius: 3px; }

  .view-toggle {
    display: flex;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
  }

  .view-toggle-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
  }

  .view-toggle-btn.active {
    background: var(--bg2);
    color: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(45, 38, 30, 0.08);
  }

  .popup-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #FAF8F4;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
  }

  .popup-add-form input, .popup-add-form select {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
  }

  .popup-add-form input:focus, .popup-add-form select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(186, 74, 27, 0.10);
  }
  .popup-add-form select option { background: var(--bg2); color: var(--text); }

  /* ===== 24h Timeline List ===== */
  .timeline-container {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #FAF8F4;
    position: relative;
    overflow-y: auto;
    flex: 1;
    min-height: 380px;
  }

  .timeline-container::-webkit-scrollbar { width: 5px; }
  .timeline-container::-webkit-scrollbar-track { background: var(--bg3); border-radius: 3px; }
  .timeline-container::-webkit-scrollbar-thumb { background: #D5CEC2; border-radius: 3px; }

  .untimed-section {
    background: #F4F0E8;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
  }

  .untimed-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .timeline-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    min-height: 52px;
    border-bottom: 1px solid rgba(45, 38, 30, 0.06);
    position: relative;
    transition: background 0.15s;
  }

  .timeline-row:hover {
    background: rgba(45, 38, 30, 0.02);
  }

  .timeline-hour {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    border-right: 1px solid var(--border);
    background: rgba(45, 38, 30, 0.015);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-family: Consolas, monospace, sans-serif;
  }

  .timeline-slot {
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    min-height: 48px;
    justify-content: center;
  }

  .slot-empty-btn {
    opacity: 0;
    font-size: 11px;
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s, color 0.15s;
    align-self: flex-start;
  }

  .timeline-row:hover .slot-empty-btn {
    opacity: 1;
  }

  .slot-empty-btn:hover {
    color: var(--accent);
    background: rgba(186, 74, 27, 0.08);
  }

  /* Current time marker line */
  .current-time-marker {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 10;
    pointer-events: none;
  }

  .current-time-marker::before {
    content: '';
    position: absolute;
    left: 60px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 6px #ef4444;
  }

  .timeline-task {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-left: 4px solid var(--silver-dim);
    border-radius: 8px;
    padding: 6px 10px;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(45, 38, 30, 0.04);
  }

  .timeline-task:hover {
    border-color: var(--accent);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(45, 38, 30, 0.08);
  }

  .timeline-task.p-high { border-left-color: #ef4444; }
  .timeline-task.p-medium { border-left-color: #f59e0b; }
  .timeline-task.p-low { border-left-color: #10b981; }

  .timeline-task.done {
    opacity: 0.6;
    background: #F2EFE8;
  }

  .timeline-task.done .task-title {
    text-decoration: line-through;
    color: var(--text-dim);
  }

  .timeline-task input[type="checkbox"] {
    appearance: none;
    width: 18px; height: 18px;
    border: 2px solid #C4BEB4;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    background: #FFFFFF;
  }

  .timeline-task input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
  }

  .timeline-task input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
  }

  .task-time-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(186, 74, 27, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Consolas, monospace, sans-serif;
  }

  .btn-icon {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
  }
  .btn-icon:hover { color: var(--text); background: rgba(45, 38, 30, 0.06); box-shadow: none; }
  .btn-icon.del:hover { color: #ef4444; background: #fef2f2; }

  /* ===== Modal Boxes ===== */
  .modal-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #FAF8F4;
  }

  .modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--silver);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .modal-close {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
  }
  .modal-close:hover { color: var(--text); background: rgba(45, 38, 30, 0.08); }

  .modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 4px;
  }

  .tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-dim);
    cursor: pointer;
  }
  .tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
    background: transparent;
    box-shadow: none;
  }

  .drop-zone {
    border: 2px dashed rgba(45, 38, 30, 0.2);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    background: #FAF8F4;
    cursor: pointer;
    transition: all 0.2s;
  }
  .drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(186, 74, 27, 0.04);
  }
  .drop-zone input[type="file"] { display: none; }
  .drop-zone-icon { font-size: 32px; margin-bottom: 8px; }
  .drop-zone-text { font-size: 14px; color: var(--silver); font-weight: 600; }
  .drop-zone-hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

  .paste-textarea {
    width: 100%;
    min-height: 120px;
    background: #FAF8F4;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px;
    font-family: Consolas, monospace, sans-serif;
    font-size: 13px;
    resize: vertical;
    outline: none;
  }
  .paste-textarea:focus { border-color: var(--accent); background: #FFFFFF; }

  .option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #FAF8F4;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
  }

  .option-group label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
  }

  .preview-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--silver);
    display: flex;
    justify-content: space-between;
  }

  .preview-table-container {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FAF8F4;
  }

  .preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
  }

  .preview-table th {
    background: #F2EFE8;
    padding: 8px 10px;
    color: var(--silver);
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
  }

  .preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }

  .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #FAF8F4;
    flex-wrap: wrap;
    gap: 10px;
  }

  .modal-footer-left { display: flex; gap: 8px; }
  .modal-footer-right { display: flex; gap: 8px; }

  .btn-confirm {
    background: #15803d;
    border: 1px solid #16a34a;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
  }
  .btn-confirm:hover {
    background: #166534;
    box-shadow: 0 2px 8px rgba(21, 128, 61, 0.25);
  }

  .btn-delete-modal {
    background: #b91c1c;
    border: 1px solid #dc2626;
    color: #fff;
    font-weight: 600;
    border-radius: 8px;
  }
  .btn-delete-modal:hover {
    background: #991b1b;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.25);
  }

  .btn-secondary {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
  }

  .export-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FAF8F4;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .info-hint {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
  }

  .edit-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .edit-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--silver-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .edit-form-group input, .edit-form-group select {
    background: #FAF8F4;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    outline: none;
  }
  .edit-form-group input:focus, .edit-form-group select:focus {
    border-color: var(--accent);
    background: #FFFFFF;
  }

  /* Image Preview Box */
  .day-img-preview {
    width: 100%;
    height: 160px;
    border-radius: 10px;
    border: 2px dashed var(--border);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 13px;
    position: relative;
    overflow: hidden;
  }

  /* Responsive Mobile */
  @media (max-width: 600px) {
    body { padding: 12px; }
    .panel { padding: 14px; border-radius: 12px; }
    .weekdays { gap: 4px; margin-bottom: 6px; }
    .weekday { font-size: 10px; padding: 4px 0; }
    .days { gap: 5px; }
    .day {
      aspect-ratio: auto;
      min-height: 52px;
      border-radius: 8px;
      padding: 5px;
    }
    .day .d-num { font-size: 13px; }
    .dot { width: 6px; height: 6px; }
    h1 { font-size: 20px; letter-spacing: 1px; }
    .stat-card { padding: 6px 12px; min-width: 64px; }
    .stat-card .num { font-size: 17px; }
    .cal-title { font-size: 16px; }
    button { padding: 6px 10px; font-size: 13px; }
    .header-actions { width: 100%; justify-content: space-between; }
    .modal-box, .timeline-modal-box { max-height: 95vh; }
  }
