/* SNS Marketing Agency Dashboard - Light Mode Default */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #FFFFFF; --bg-card: #F8F9FA; --bg-card-hover: #F1F3F5; --bg-input: #F8F9FA;
  --border: #E9ECEF; --border-light: #F1F3F5;
  --text: #1A1A2E; --text-secondary: #495057; --text-muted: #6C757D; --text-light: #ADB5BD;
  --primary: #4F46E5; --primary-light: #818CF8; --primary-bg: rgba(79,70,229,0.08);
  --success: #16A34A; --warning: #D97706; --danger: #DC2626; --info: #2563EB; --purple: #9333EA;
  --sidebar-bg: #1E293B; --sidebar-text: #CBD5E1; --sidebar-active: rgba(99,102,241,0.25);
}
.dark {
  --bg: #1A1A2E; --bg-card: #16213E; --bg-card-hover: #1E2D4A; --bg-input: #16213E;
  --border: #2A3A5C; --border-light: #16213E;
  --text: #E2E8F0; --text-secondary: #CBD5E1; --text-muted: #94A3B8; --text-light: #64748B;
  --primary: #818CF8; --primary-light: #A5B4FC; --primary-bg: rgba(129,140,248,0.12);
  --success: #4ADE80; --warning: #FBBF24; --danger: #F87171; --info: #60A5FA; --purple: #A78BFA;
  --sidebar-bg: #0F3460;
}
body { font-family: 'Pretendard Variable', 'Pretendard', 'Noto Sans KR', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Animations */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 50%, var(--bg-card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
.toast-enter { animation: slideIn 0.3s ease-out; }
.toast-exit { animation: slideOut 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-overlay { animation: fadeIn 0.2s ease; }
.modal-content { animation: scaleIn 0.2s ease; }
@keyframes pulse { 0%,100%{transform:scale(1);} 50%{transform:scale(1.15);} }
.badge-pulse { animation: pulse 2s infinite; }

/* Layout */
.sidebar { transition: width 0.3s ease, transform 0.3s ease; background: var(--sidebar-bg); }
.sidebar-collapsed { width: 64px !important; }
.sidebar-collapsed .sidebar-label { display: none; }
.sidebar-collapsed .sidebar-logo-text { display: none; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; transition: all 0.2s ease; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.card-interactive:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }

/* Progress */
.progress-bar { transition: width 0.6s ease; }

/* Status badges */
.status-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; border: 1px solid; }
.st-waiting { background: #F1F5F9; color: #64748B; border-color: #CBD5E1; }
.st-generating { background: #FFFBEB; color: #B45309; border-color: #FCD34D; }
.st-reviewing { background: #EFF6FF; color: #1D4ED8; border-color: #93C5FD; }
.st-client-review { background: #FAF5FF; color: #7C3AED; border-color: #C4B5FD; }
.st-completed { background: #F0FDF4; color: #15803D; border-color: #86EFAC; }
.st-delayed { background: #FEF2F2; color: #B91C1C; border-color: #FCA5A5; }
.dark .st-waiting { background: rgba(100,116,139,0.15); color: #94A3B8; border-color: rgba(100,116,139,0.3); }
.dark .st-generating { background: rgba(217,119,6,0.15); color: #FBBF24; border-color: rgba(217,119,6,0.3); }
.dark .st-reviewing { background: rgba(37,99,235,0.15); color: #60A5FA; border-color: rgba(37,99,235,0.3); }
.dark .st-client-review { background: rgba(124,58,237,0.15); color: #A78BFA; border-color: rgba(124,58,237,0.3); }
.dark .st-completed { background: rgba(22,163,74,0.15); color: #4ADE80; border-color: rgba(22,163,74,0.3); }
.dark .st-delayed { background: rgba(220,38,38,0.15); color: #F87171; border-color: rgba(220,38,38,0.3); }

/* Platform icons */
.pi { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 9px; font-weight: 700; color: white; flex-shrink: 0; }
.pi-naver { background: #03C75A; } .pi-wordpress { background: #21759B; } .pi-tistory { background: #FF5A4A; }
.pi-instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.pi-youtube { background: #FF0000; } .pi-facebook { background: #1877F2; }
.pi-threads { background: #000; } .pi-twitter { background: #1DA1F2; } .pi-x { background: #000; }
.dark .pi-threads { background: #fff; color: #000; } .dark .pi-x { background: #fff; color: #000; }

/* Kanban */
.kanban-card { cursor: grab; transition: all 0.15s ease; }
.kanban-card:active { cursor: grabbing; transform: rotate(1.5deg); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-drop-zone.drag-over { background: var(--primary-bg); border: 2px dashed var(--primary); border-radius: 12px; }

/* Calendar */
.cal-cell { min-height: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: var(--bg-card); transition: background 0.15s; cursor: pointer; }
.cal-cell:hover { background: var(--bg-card-hover); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* Toggle */
.toggle { width: 40px; height: 22px; border-radius: 11px; position: relative; cursor: pointer; transition: background 0.3s; }
.toggle.on { background: var(--primary); } .toggle.off { background: var(--text-light); }
.toggle-knob { width: 16px; height: 16px; border-radius: 50%; background: white; position: absolute; top: 3px; transition: left 0.3s; }
.toggle.on .toggle-knob { left: 21px; } .toggle.off .toggle-knob { left: 3px; }

/* Tab */
.tab { padding: 8px 16px; font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text-muted); transition: all 0.2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Form */
.input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-size: 13px; border-radius: 8px; padding: 8px 12px; outline: none; transition: border-color 0.2s; }
.input:focus { border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: var(--primary); color: white; } .btn-primary:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: white; } .btn-success:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: white; } .btn-warning:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); } .btn-outline:hover { background: var(--bg-card); }
.btn-ghost { background: transparent; color: var(--text-muted); } .btn-ghost:hover { color: var(--text); background: var(--bg-card); }

/* Change indicators */
.change-up { color: var(--success); } .change-down { color: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
}

/* User dropdown */
#user-dropdown { border-radius: 12px; }
#user-dropdown button:hover { background: var(--bg-card-hover); }

/* ===== Chat ===== */
.chat-wrap { display: flex; height: calc(100vh - 130px); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-card); }
.chat-sidebar { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg-card); }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-room-list { flex: 1; overflow-y: auto; }
.chat-room-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border-light); }
.chat-room-item:hover { background: var(--bg-card-hover); }
.chat-room-item.active { background: var(--primary-bg); border-left: 3px solid var(--primary); }
.chat-room-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.chat-room-avatar.sm-av { width: 32px; height: 32px; font-size: 12px; }
.chat-room-info { flex: 1; min-width: 0; }
.chat-unread-badge { min-width: 18px; height: 18px; padding: 0 5px; background: #EF4444; color: white; border-radius: 9px; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-detail-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg-row { display: flex; gap: 8px; max-width: 75%; }
.chat-msg-row.left { align-self: flex-start; }
.chat-msg-row.right { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 10px; flex-shrink: 0; margin-top: 16px; }
.chat-msg-content { display: flex; flex-direction: column; min-width: 0; }
.chat-msg-name { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.chat-msg-name.right { justify-content: flex-end; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; max-width: 100%; word-break: break-word; }
.chat-bubble-client { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.chat-bubble-worker { background: var(--primary); color: white; border-top-right-radius: 4px; }
.chat-bubble-ai { background: var(--purple); color: white; border-top-right-radius: 4px; }
.chat-ai-badge { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: var(--purple); color: white; font-weight: 700; }
.chat-msg-time { font-size: 10px; color: var(--text-light); margin-top: 2px; }
.chat-msg-time.right { text-align: right; }
.chat-img-grid { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.chat-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: opacity 0.15s; }
.chat-thumb:hover { opacity: 0.8; }
.chat-input-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.chat-text-input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-size: 13px; border-radius: 20px; padding: 9px 16px; outline: none; transition: border-color 0.2s; }
.chat-text-input:focus { border-color: var(--primary); }
.chat-attach-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 15px; }
.chat-attach-btn:hover { color: var(--text); background: var(--bg-card-hover); }
.chat-send-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--primary); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 14px; }
.chat-send-btn:hover { opacity: 0.85; }
.chat-back-btn { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.chat-back-btn:hover { background: var(--bg-card-hover); color: var(--text); }

@media (max-width: 768px) {
  .chat-sidebar { width: 100%; }
  .chat-wrap { flex-direction: column; }
  .chat-mobile-list .chat-main { display: none; }
  .chat-mobile-list .chat-sidebar { width: 100%; }
  .chat-mobile-detail .chat-sidebar { display: none; }
  .chat-mobile-detail .chat-main { width: 100%; }
  .chat-msg-row { max-width: 85%; }
}

/* ===== Image Gallery ===== */
.img-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.img-gallery-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--bg-input); }
.img-gallery-thumb { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform 0.2s, opacity 0.2s; }
.img-gallery-thumb:hover { transform: scale(1.03); opacity: 0.9; }
.img-dl-btn { position: absolute; bottom: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.6); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: background 0.2s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.img-dl-btn:hover { background: rgba(0,0,0,0.85); }
.copy-btn { flex-shrink: 0; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); font-size: 11px; cursor: pointer; transition: all 0.2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
@media (max-width: 768px) { .img-gallery { grid-template-columns: repeat(2, 1fr); } }

/* ===== Chat Widget ===== */
.chat-widget-fab { position: fixed; bottom: 20px; right: 20px; width: 52px; height: 52px; border-radius: 50%; background: #4F46E5; color: white; font-size: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(79,70,229,0.4); z-index: 100; transition: transform 0.2s; border: none; }
.chat-widget-fab:hover { transform: scale(1.08); }
.chat-widget { position: fixed; bottom: 20px; right: 20px; width: 340px; max-height: 440px; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.18); z-index: 100; display: flex; flex-direction: column; border: 1px solid var(--border); background: var(--bg-card); }
.chat-widget-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #4F46E5; }
.chat-widget-body { flex: 1; overflow-y: auto; padding: 10px; min-height: 200px; max-height: 280px; background: var(--bg); }
.chat-widget-input { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--bg-card); }
.cw-msg { display: flex; flex-direction: column; margin-bottom: 8px; }
.cw-left { align-items: flex-start; }
.cw-right { align-items: flex-end; }
.cw-bubble { padding: 8px 12px; border-radius: 12px; max-width: 80%; word-break: break-word; }
.cw-b-client { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.cw-b-worker { background: #4F46E5; color: white; border-top-right-radius: 4px; }
@media (max-width: 768px) { .chat-widget { width: calc(100vw - 32px); right: 16px; bottom: 16px; } }

/* ===== Upload Page ===== */
.upload-page { min-height: 100vh; min-height: -webkit-fill-available; background: #FFFFFF; display: flex; justify-content: center; font-family: 'Pretendard Variable', 'Pretendard', sans-serif; -webkit-font-smoothing: antialiased; }
.upload-container { width: 100%; max-width: 480px; padding: 24px 16px; padding-bottom: 80px; }
.upload-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; border-radius: 12px; font-size: 18px; font-weight: 600; cursor: pointer; transition: opacity 0.2s, -webkit-transform 0.15s, transform 0.15s; border: none; -webkit-appearance: none; -webkit-tap-highlight-color: transparent; }
.upload-btn:active { -webkit-transform: scale(0.98); transform: scale(0.98); }
.upload-thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.upload-thumb-wrap { position: relative; width: 80px; height: 80px; border-radius: 10px; overflow: hidden; }
.upload-thumb { width: 100%; height: 100%; object-fit: cover; }
.upload-remove-btn { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,0.6); color: white; border: none; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.upload-file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #F8F9FA; margin-bottom: 8px; }
.upload-x { width: 28px; height: 28px; border-radius: 50%; border: none; background: #E9ECEF; color: #6C757D; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.upload-preview-area { max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.upload-submit-wrap { position: -webkit-sticky; position: sticky; bottom: 0; padding: 12px 0; background: #FFFFFF; }
.upload-submit-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; border-radius: 12px; background: #4F46E5; color: white; font-size: 17px; font-weight: 700; border: none; cursor: pointer; transition: opacity 0.2s; -webkit-appearance: none; -webkit-tap-highlight-color: transparent; }
.upload-submit-btn.disabled { background: #ADB5BD; cursor: default; }
.upload-submit-btn:not(.disabled):active { opacity: 0.85; }

/* ===== Calendar Enhanced ===== */
.cal-cell-empty { min-height: 120px; border: 1px solid transparent; opacity: 0.3; }
.cal-today-num { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cal-task-list { display: flex; flex-direction: column; gap: 3px; }
.cal-task-item { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cal-task-label { flex: 1; min-width: 0; }
.cal-task-icons { display: flex; flex-wrap: wrap; gap: 2px; flex-shrink: 0; }
.cal-modal-task { padding: 12px; border-radius: 10px; background: var(--bg-input); margin-bottom: 8px; cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.cal-modal-task:hover { border-color: var(--primary); background: var(--primary-bg); transform: translateX(2px); }
@media (max-width: 640px) { .cal-cell { min-height: 80px; padding: 4px; } .cal-task-icons .pi { width: 14px !important; height: 14px !important; font-size: 5px !important; } }

/* ===== Settings Enhanced ===== */
.settings-action-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; transition: all 0.2s; width: 100%; text-align: left; }
.settings-action-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-bg); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.settings-action-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.settings-action-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.settings-staff-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.settings-staff-card { display: flex; flex-direction: column; align-items: center; padding: 20px 12px; border-radius: 12px; background: var(--bg-input); text-align: center; }
.settings-staff-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 18px; }
.settings-env-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 12px; }
.settings-env-item { padding: 12px 16px; border-radius: 10px; background: var(--bg-input); }
@media (min-width: 640px) { .settings-env-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .settings-staff-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .settings-staff-card { padding: 14px 8px; } }

/* ===== Report Page ===== */
.report-summary-card { position: relative; overflow: hidden; }
.report-summary-card::before { content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px; border-radius: 50%; opacity: 0.05; transform: translate(20px, -20px); }
.report-chart-wrap { position: relative; height: 260px; width: 100%; }
.report-table th { white-space: nowrap; }
.report-table td { vertical-align: middle; }
@media (max-width: 640px) { .report-chart-wrap { height: 200px; } }

/* ===== Client Detail Tabs ===== */
.cd-tabs-bar { display: flex; gap: 2px; border-bottom: 2px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cd-tabs-bar::-webkit-scrollbar { display: none; }
.cd-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; font-size: 13px; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text-muted); transition: all 0.2s; white-space: nowrap; margin-bottom: -2px; border: none; background: none; }
.cd-tab:hover { color: var(--text); background: var(--bg-card-hover); border-radius: 8px 8px 0 0; }
.cd-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.cd-tab i { font-size: 12px; }
@media (max-width: 640px) { .cd-tab { padding: 8px 12px; font-size: 12px; } .cd-tab span { display: none; } .cd-tab i { font-size: 14px; } }

/* Client Detail: Inline editing */
.cd-field-grid { display: flex; flex-direction: column; gap: 0; }
.cd-field-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.cd-field-row:last-child { border-bottom: none; }
.cd-field-label { width: 90px; flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--text-muted); padding-top: 4px; }
.cd-inline-val { flex: 1; min-height: 28px; font-size: 14px; color: var(--text); padding: 3px 8px; border-radius: 6px; border: 1px solid transparent; transition: all 0.15s; cursor: pointer; word-break: break-word; }
.cd-inline-editable:hover { background: var(--primary-bg); border-color: var(--primary); }
.cd-inline-val.editing { padding: 0; border-color: transparent; background: none; cursor: default; }
.cd-inline-val.editing:hover { background: none; border-color: transparent; }
.cd-inline-input { width: 100%; background: var(--bg-input); border: 2px solid var(--primary); color: var(--text); font-size: 14px; border-radius: 6px; padding: 6px 10px; outline: none; transition: border-color 0.2s; }
.cd-inline-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
textarea.cd-inline-input { resize: vertical; min-height: 60px; font-family: inherit; }

/* Client Detail: Prompt editor */
.cd-prompt-layout { display: flex; min-height: 500px; }
.cd-prompt-sidebar { width: 200px; flex-shrink: 0; border-right: 1px solid var(--border); padding-bottom: 12px; overflow-y: auto; background: var(--bg-card); }
.cd-prompt-plat-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; font-size: 13px; text-align: left; border: none; background: none; cursor: pointer; color: var(--text-muted); transition: all 0.15s; border-left: 3px solid transparent; }
.cd-prompt-plat-btn:hover { background: var(--bg-card-hover); color: var(--text); }
.cd-prompt-plat-btn.active { background: var(--primary-bg); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.cd-prompt-editor { flex: 1; padding: 20px; overflow-y: auto; min-width: 0; }
.cd-prompt-textarea { width: 100%; height: 300px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace; border-radius: 8px; padding: 14px 16px; outline: none; resize: vertical; transition: border-color 0.2s; line-height: 1.6; }
.cd-prompt-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }
@media (max-width: 768px) { .cd-prompt-layout { flex-direction: column; min-height: auto; } .cd-prompt-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding-bottom: 0; } .cd-prompt-plat-btn { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; flex-shrink: 0; padding: 10px 14px; } .cd-prompt-plat-btn.active { border-left-color: transparent; border-bottom-color: var(--primary); } .cd-prompt-sidebar p { display: none; } .cd-prompt-editor { padding: 16px; } .cd-prompt-textarea { height: 200px; } }

/* Client Detail: Files grid */
.cd-file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cd-file-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--bg-input); transition: all 0.15s; }
.cd-file-item:hover { background: var(--bg-card-hover); }
.cd-file-thumb { width: 48px; height: 48px; border-radius: 8px; background: var(--bg-card-hover); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.cd-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cd-file-info { flex: 1; min-width: 0; }
@media (max-width: 640px) { .cd-file-grid { grid-template-columns: 1fr; } }

/* ===== Task Detail Slide Panel ===== */
.td-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 150; transition: background 0.3s ease; }
.td-overlay.active { background: rgba(0,0,0,0.4); }
.td-panel { position: fixed; top: 0; right: 0; width: 520px; max-width: 100vw; height: 100vh; z-index: 160; background: var(--bg); border-left: 1px solid var(--border); box-shadow: -8px 0 32px rgba(0,0,0,0.12); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.td-panel.open { transform: translateX(0); }
.td-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.td-close-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.2s; flex-shrink: 0; }
.td-close-btn:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--text-muted); }
.td-body { flex: 1; overflow-y: auto; padding: 0; }
.td-section { padding: 20px; border-bottom: 1px solid var(--border); }
.td-section:last-child { border-bottom: none; }
.td-section-danger { background: rgba(220,38,38,0.03); }
.dark .td-section-danger { background: rgba(220,38,38,0.06); }
.td-section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.td-section-title i:first-child { font-size: 13px; }

/* Task Detail: Info grid */
.td-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.td-info-item { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 8px; background: var(--bg-input); }
.td-info-label { font-size: 10px; font-weight: 500; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.02em; }
.td-info-value { font-size: 13px; color: var(--text); font-weight: 500; }

/* Task Detail: File badges */
.td-file-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.td-file-badge-img { background: #EFF6FF; color: #2563EB; }
.td-file-badge-vid { background: #FAF5FF; color: #9333EA; }
.td-file-badge-note { background: #F0FDF4; color: #16A34A; }
.dark .td-file-badge-img { background: rgba(37,99,235,0.15); color: #60A5FA; }
.dark .td-file-badge-vid { background: rgba(147,51,234,0.15); color: #A78BFA; }
.dark .td-file-badge-note { background: rgba(22,163,74,0.15); color: #4ADE80; }
.td-file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg-input); transition: background 0.15s; }
.td-file-row:hover { background: var(--bg-card-hover); }
.td-file-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-card-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.td-file-action { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: all 0.2s; flex-shrink: 0; }
.td-file-action:hover { color: var(--primary); border-color: var(--primary); }

/* Task Detail: AI Analysis grades */
.td-ai-result { padding: 0; }
.td-ai-grade { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 10px; border: 1px solid; }
.td-ai-grade-letter { font-size: 28px; font-weight: 800; width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: white; flex-shrink: 0; }
.dark .td-ai-grade-letter { background: rgba(0,0,0,0.2); }

/* Task Detail: Placeholder */
.td-placeholder { display: flex; align-items: center; gap: 8px; padding: 16px; border-radius: 8px; background: var(--bg-input); color: var(--text-light); font-size: 13px; }
.td-placeholder i { font-size: 14px; }

/* Task Detail: Accordion */
.td-accordion-toggle { cursor: pointer; user-select: none; transition: color 0.15s; }
.td-accordion-toggle:hover { color: var(--primary); }
.td-accordion-arrow { margin-left: auto; font-size: 11px; transition: transform 0.25s; color: var(--text-light); }
.td-accordion-arrow.rotated { transform: rotate(180deg); }
.td-accordion-body { overflow: hidden; max-height: 500px; transition: max-height 0.3s ease, opacity 0.3s; opacity: 1; }
.td-accordion-body.collapsed { max-height: 0; opacity: 0; padding: 0; }

/* Task Detail: Edit plan step */
.td-plan-step { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.td-plan-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* Task Detail: Publication URLs */
.td-pub-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg-input); }
.td-pub-unpublished { font-size: 12px; color: var(--text-light); padding: 2px 10px; border-radius: 12px; background: var(--border); }

/* Task Detail: Review History Timeline */
.td-timeline { position: relative; padding-left: 24px; }
.td-timeline-item { position: relative; padding-bottom: 20px; padding-left: 20px; }
.td-timeline-item:not(.td-timeline-last)::before { content: ''; position: absolute; left: -24px; top: 28px; bottom: 0; width: 2px; background: var(--border); margin-left: 11px; }
.td-timeline-dot { position: absolute; left: -24px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; z-index: 1; }
.td-timeline-content { min-width: 0; }
.td-timeline-type { display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--primary-bg); color: var(--primary); }
.td-timeline-last { padding-bottom: 0; }

/* ===== Dashboard Mini Calendar ===== */
.mini-cal-day { width: 100%; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; transition: background 0.15s; position: relative; gap: 1px; }
.mini-cal-day:hover { background: var(--bg-card-hover); }
.mini-cal-today { background: var(--primary) !important; border-radius: 50%; }
.mini-cal-today:hover { opacity: 0.9; }
.mini-cal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); position: absolute; bottom: 2px; }
.mini-cal-today .mini-cal-dot { background: white; }

/* ===== Responsive: Task Detail Panel ===== */
@media (max-width: 640px) {
  .td-panel { width: 100vw; }
  .td-info-grid { grid-template-columns: 1fr; }
}
.pi-linkedin { background: #0A66C2; }

/* ===== AI Assistant Widget ===== */
.ai-fab {
  position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px;
  border-radius: 50%; background: #7C3AED; color: white; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; z-index: 9000;
  box-shadow: 0 4px 20px rgba(124,58,237,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(124,58,237,0.55); }

.ai-panel {
  position: fixed; bottom: 24px; right: 24px; width: 380px; height: 520px;
  border-radius: 16px; background: #FFFFFF; z-index: 9001;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; overflow: hidden;
}
.dark .ai-panel { background: #1E1E2E; }

.ai-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: #7C3AED; flex-shrink: 0;
}

.ai-messages {
  flex: 1; overflow-y: auto; padding: 14px; display: flex;
  flex-direction: column; gap: 10px; background: #FAFAFA;
}
.dark .ai-messages { background: #16162A; }

.ai-bubble-ai {
  align-self: flex-start; max-width: 85%; padding: 10px 14px;
  border-radius: 4px 16px 16px 16px; background: #EDE9FE; color: #1E1B4B;
  font-size: 13px; line-height: 1.6; word-break: break-word;
}
.dark .ai-bubble-ai { background: #312E81; color: #E0E7FF; }

.ai-bubble-user {
  align-self: flex-end; max-width: 80%; padding: 10px 14px;
  border-radius: 16px 4px 16px 16px; background: #DBEAFE; color: #1E3A5F;
  font-size: 13px; line-height: 1.5; word-break: break-word;
}
.dark .ai-bubble-user { background: #1E3A5F; color: #DBEAFE; }

.ai-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid #E5E7EB; background: #FFFFFF; flex-shrink: 0;
}
.dark .ai-input-bar { border-top-color: #2A2A40; background: #1E1E2E; }

.ai-input-field {
  flex: 1; background: #F3F4F6; border: 1px solid #E5E7EB; color: #1A1A2E;
  font-size: 13px; border-radius: 20px; padding: 9px 16px; outline: none;
  transition: border-color 0.2s;
}
.ai-input-field:focus { border-color: #7C3AED; }
.dark .ai-input-field { background: #16162A; border-color: #2A2A40; color: #E2E8F0; }
.dark .ai-input-field:focus { border-color: #7C3AED; }

.ai-send-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: #7C3AED; color: white; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s; flex-shrink: 0;
}
.ai-send-btn:hover { opacity: 0.85; }

/* AI Typing animation */
.ai-typing { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #7C3AED;
  animation: aiTypingDot 1.4s infinite ease-in-out both;
}
.ai-typing span:nth-child(1) { animation-delay: 0s; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiTypingDot {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
  .ai-panel { width: calc(100vw - 32px); height: calc(100vh - 120px); right: 16px; bottom: 16px; }
  .ai-fab { bottom: 16px; right: 16px; width: 52px; height: 52px; font-size: 20px; }
}

/* Review Page Two-Column Layout */
.rv-two-col { display: grid; grid-template-columns: 60% 40%; gap: 24px; }
.rv-left { min-width: 0; }
.rv-right { min-width: 0; }
@media (max-width: 768px) {
  .rv-two-col { grid-template-columns: 1fr; }
  .rv-left { order: 1; }
  .rv-right { order: 2; }
}
