/* ============ DURALUX-INSPIRED DESIGN SYSTEM ============ */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

:root {
  --font-primary: 'Rubik', sans-serif;

  /* Duralux light palette */
  --bg: #f5f6fa;
  --bg-elevated: #ffffff;
  --bg-sidebar: #ffffff;
  --text: #2d3436;
  --text-muted: #8a94a6;
  --border: #e8ecf0;
  --primary: #4361ee;
  --primary-hover: #3451db;
  --accent: #7c6fe0;
  --success: #0acf97;
  --warning: #ffab2d;
  --danger: #fa5c7c;
  --info: #39afd1;

  --shadow: 0 2px 8px rgba(43,55,72,0.07);
  --shadow-lg: 0 8px 32px rgba(43,55,72,0.14);
  --radius: 8px;
  --radius-sm: 5px;
  --transition: 0.18s ease;

  /* Duralux spacing */
  --sidebar-width: 240px;
  --topbar-height: 58px;
  --content-padding: 24px;
}

[data-theme="dark"] {
  --bg: #1a1d2e;
  --bg-elevated: #222639;
  --bg-sidebar: #1c1f32;
  --text: #d8dce8;
  --text-muted: #7b84a3;
  --border: #2d3150;
  --primary: #4361ee;
  --primary-hover: #3451db;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--text);
  /* FIX #2: Duralux uses 13.5px base font, tighter line-height */
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  letter-spacing: 0.01em;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select {
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-size: 13px;
  letter-spacing: 0.01em;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,0.12);
}
svg { flex-shrink: 0; }

/* ===== APP SHELL ===== */
.app { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 0 20px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}

.logo {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.logo .fa { color: var(--primary); font-size: 18px; flex-shrink: 0; }
.logo-text { transition: opacity 0.2s, width 0.2s; }
.logo-accent { color: var(--primary); }

.nav { padding: 8px 0; flex: 1; overflow: hidden; }

/* FIX #5: Nav sections with separators */
.nav-section { padding: 4px 0 6px; }

/* Separator lines between sections */
.nav-section + .nav-section {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.nav-section-title {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 6px 20px 4px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.2s, height 0.2s;
}

/* FIX #6: Modern lined/stroked icon style for nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  border-left: 3px solid transparent;
  position: relative;
  letter-spacing: 0.01em;
}

/* FIX #6: Use outlined/stroke-style icons — Font Awesome already has line variants */
.nav-icon {
  font-size: 15px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  transition: color var(--transition);
  opacity: 0.75;
}

.nav-label {
  transition: opacity 0.2s;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(67,97,238,0.06);
  color: var(--primary);
  border-left-color: transparent;
}
.nav-item:hover .nav-icon { color: var(--primary); opacity: 1; }

.nav-item.active {
  background: rgba(67,97,238,0.08);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--primary); opacity: 1; }

/* ===== ICON-ONLY SIDEBAR ===== */
.sidebar.icon-only {
  width: 62px !important;
}

.sidebar.icon-only .logo-text,
.sidebar.icon-only .nav-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* FIX #5: In icon-only mode, hide labels but keep section separators visible */
.sidebar.icon-only .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

/* Keep the border separator visible in icon-only mode */
.sidebar.icon-only .nav-section + .nav-section {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 4px;
}

.sidebar.icon-only .sidebar-header {
  padding: 0;
  justify-content: center;
}

.sidebar.icon-only .nav-item {
  padding: 10px 0;
  justify-content: center;
  border-left: none;
  border-right: 3px solid transparent;
}

.sidebar.icon-only .nav-item.active {
  border-left: none;
  border-right-color: var(--primary);
}

.sidebar.icon-only .nav-icon {
  font-size: 17px;
  width: auto;
  opacity: 1;
}

/* Tooltip on hover in icon-only mode */
.sidebar.icon-only .nav-item::after {
  content: attr(title);
  position: fixed;
  left: 72px;
  background: var(--text);
  color: var(--bg-elevated);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 999;
  box-shadow: var(--shadow);
}
.sidebar.icon-only .nav-item:hover::after { opacity: 1; }

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.25s cubic-bezier(.4,0,.2,1);
  /* FIX #1: Ensure main takes full available width */
  width: calc(100% - var(--sidebar-width));
}

.sidebar.icon-only ~ .main {
  margin-left: 62px;
  width: calc(100% - 62px);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: var(--topbar-height);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  /* FIX #1: Full width */
  width: 100%;
}

.search-box { flex: 1; max-width: 400px; position: relative; }
.search-box input {
  padding-left: 36px;
  border-radius: 20px;
  font-size: 13px;
  background: var(--bg);
  border-color: transparent;
}
.search-box input:focus { background: var(--bg-elevated); border-color: var(--primary); }
.search-box::before {
  content: '\f002';
  font-family: FontAwesome;
  position: absolute;
  left: 12px;
  top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  z-index: 1;
}

.topbar-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }

/* ===== PAGE CONTAINER — FIX #1: Full width, no max-width cap ===== */
.page-container {
  padding: var(--content-padding);
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  /* FIX #2: Duralux uses slightly more generous content spacing */
  padding: 20px 24px 32px;
}

/* ===== CALENDAR ===== */
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.calendar-nav { display: flex; align-items: center; gap: 8px; }
/* FIX #2: Duralux-style title — slightly larger, tighter weight */
.calendar-title {
  font-family: 'Rubik', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-left: 12px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.view-switch {
  display: flex; gap: 4px;
  background: var(--bg-elevated);
  padding: 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.view-switch button {
  padding: 5px 13px; border-radius: 4px; font-size: 12.5px;
  color: var(--text-muted); transition: all var(--transition); font-weight: 500;
}
.view-switch button.active { background: var(--primary); color: white; }

/* MONTH VIEW */
.calendar-grid.month-view {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  /* FIX #1: Full width */
  width: 100%;
}
.cal-dayname {
  padding: 10px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.cal-day {
  min-height: 110px; padding: 6px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
  display: flex; flex-direction: column; gap: 4px;
}
.cal-day:hover { background: rgba(67,97,238,0.04); }
.cal-day.other-month { opacity: 0.4; }
.cal-day.today { background: rgba(67,97,238,0.05); }
.cal-day.today .cal-day-num {
  background: var(--primary); color: white; border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.cal-day-num { font-size: 12px; font-weight: 700; padding: 2px 4px; color: var(--text); }
.cal-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-event {
  font-size: 11px; padding: 3px 6px; border-radius: 3px;
  background: var(--bg); border-left: 3px solid var(--primary);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all var(--transition);
}
.cal-event:hover { transform: translateX(2px); }
.cal-event.status-scheduled { border-left-color: #3b82f6; background: rgba(59,130,246,0.1); }
.cal-event.status-running { border-left-color: #f59e0b; background: rgba(245,158,11,0.1); }
.cal-event.status-published { border-left-color: #0acf97; background: rgba(10,207,151,0.1); }
.cal-event.status-skipped { border-left-color: var(--danger); background: rgba(250,92,124,0.1); }
.cal-event.status-todo { border-left-color: #8a94a6; background: rgba(138,148,166,0.1); }
.cal-more { font-size: 10px; color: var(--text-muted); padding: 2px 6px; }

/* WEEK VIEW */
.calendar-grid.week-view {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
  width: 100%;
}
.week-day {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 300px; padding: 10px;
}
.week-day.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-day-header {
  display: flex; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.cal-empty { font-size: 12px; color: var(--text-muted); text-align: center; padding: 20px 0; }

/* DAY VIEW */
.day-view {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); max-height: 70vh; overflow-y: auto;
  width: 100%;
}
.day-hour {
  display: grid; grid-template-columns: 80px 1fr;
  border-bottom: 1px solid var(--border); min-height: 60px;
}
.day-hour:last-child { border-bottom: none; }
.hour-label {
  padding: 10px; font-size: 11.5px; color: var(--text-muted);
  border-right: 1px solid var(--border); font-weight: 500;
}
.hour-slot {
  padding: 8px; cursor: pointer; transition: background var(--transition);
  display: flex; flex-direction: column; gap: 6px;
}
.hour-slot:hover { background: var(--bg); }
.cal-event-preview { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: normal; }

/* ===== KANBAN / WEEKLY BOARD ===== */
.kanban-board {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 10px; margin-bottom: 24px;
  width: 100%;
}
.kanban-col {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); min-height: 400px; display: flex; flex-direction: column;
}
.kanban-col.today { border-color: var(--primary); }
.kanban-col-header {
  padding: 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-day { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.kanban-date { font-family: 'Rubik', sans-serif; font-size: 20px; font-weight: 700; color: var(--primary); }
.kanban-count {
  margin-left: auto; background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.kanban-items {
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  flex: 1; min-height: 200px; transition: background var(--transition);
}
.kanban-items.horizontal {
  flex-direction: row; flex-wrap: wrap; overflow-x: auto;
}
.kanban-items.drag-over { background: rgba(67,97,238,0.07); }
.kanban-card {
  background: var(--bg); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: var(--radius-sm);
  padding: 10px; cursor: grab; transition: all var(--transition);
  display: flex; flex-direction: column; gap: 4px; min-width: 180px;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
.kanban-card.status-scheduled { border-left-color: #3b82f6; }
.kanban-card.status-running { border-left-color: #ffab2d; }
.kanban-card.status-published { border-left-color: #0acf97; }
.kanban-card.status-skipped { border-left-color: var(--danger); }
.kanban-card.status-todo { border-left-color: #8a94a6; }
.kanban-card-time { font-size: 11px; color: var(--primary); font-weight: 600; }
.kanban-card-title { font-weight: 600; font-size: 12.5px; }
.kanban-card-preview { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.kanban-empty {
  text-align: center; color: var(--text-muted); font-size: 12px;
  padding: 20px 10px; border: 2px dashed var(--border); border-radius: var(--radius-sm); margin: 10px 0;
}
.unscheduled-lane { margin-top: 20px; }

/* ===== NOTIFICATIONS DROPDOWN ===== */
.notif-dropdown {
  position: fixed; width: 380px; max-height: 500px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 150; overflow: hidden; display: flex; flex-direction: column;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.link-btn { color: var(--primary); font-size: 12px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  display: grid; grid-template-columns: 32px 1fr 24px;
  gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition); align-items: start;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(67,97,238,0.04); border-left: 3px solid var(--primary); }
.notif-icon { font-size: 18px; }
.notif-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.notif-close {
  color: var(--text-muted); font-size: 14px; width: 20px; height: 20px;
  border-radius: 4px; opacity: 0; transition: opacity var(--transition);
}
.notif-item:hover .notif-close { opacity: 1; }
.notif-close:hover { background: var(--bg); color: var(--danger); }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }

/* ===== HASHTAGS ===== */
.hashtag-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
  width: 100%;
}
.hashtag-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all var(--transition); position: relative;
}
.hashtag-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.hashtag-tag {
  font-family: 'Rubik', sans-serif; font-size: 17px; font-weight: 700;
  color: var(--primary); cursor: pointer; word-break: break-all; padding-right: 28px;
}
.hashtag-tag:hover { text-decoration: underline; }
.hashtag-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.hashtag-category {
  background: var(--bg); padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.hashtag-count { font-weight: 600; }
.hashtag-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.hashtag-actions {
  display: flex; gap: 4px; justify-content: flex-end;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.hashtag-actions button {
  width: 28px; height: 28px; border-radius: 4px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12px; transition: all var(--transition);
}
.hashtag-actions button:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== LINKS ===== */
.links-list { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.link-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 14px; align-items: center; transition: all var(--transition);
}
.link-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.link-favicon { width: 32px; height: 32px; border-radius: 6px; background: var(--bg); }
.link-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.link-title {
  font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-title:hover { color: var(--primary); text-decoration: underline; }
.link-url { font-size: 11px; color: var(--primary); font-weight: 500; }
.link-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.link-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.link-category {
  font-size: 10px; background: var(--bg); padding: 2px 8px; border-radius: 10px;
  color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.link-actions { display: flex; gap: 6px; }
.link-actions button {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); font-size: 13px; transition: all var(--transition);
}
.link-actions button:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== NOTES ===== */
.notes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
  width: 100%;
}
.note-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all var(--transition); cursor: pointer; color: var(--text); min-height: 160px;
}
.note-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.note-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.note-title { font-weight: 600; font-size: 15px; flex: 1; }
.pin-btn { font-size: 14px; opacity: 0.3; transition: opacity var(--transition); padding: 2px 6px; }
.pin-btn:hover, .pin-btn.pinned { opacity: 1; }
.pin-btn.pinned { transform: rotate(-20deg); }
.note-content {
  font-size: 13px; color: var(--text); opacity: 0.85; line-height: 1.5;
  white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 6;
  -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.note-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; }
.note-category { background: rgba(0,0,0,0.08); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.note-actions {
  display: flex; gap: 6px; justify-content: flex-end;
  border-top: 1px solid rgba(0,0,0,0.08); padding-top: 8px;
}
.note-actions button {
  font-size: 11px; padding: 4px 10px; border-radius: 4px;
  background: rgba(255,255,255,0.6); border: 1px solid rgba(0,0,0,0.1); transition: all var(--transition);
}
.note-actions button:hover { background: white; }
[data-theme="dark"] .note-card { color: var(--text); }
[data-theme="dark"] .note-card[style*="background"] { color: #1a1d21; }
[data-theme="dark"] .note-card[style*="background"] .note-actions button {
  color: #1a1d21; background: rgba(255,255,255,0.7);
}

/* Color picker */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--primary); border-width: 3px; transform: scale(1.1); }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; }

/* ===== ATTACHMENTS ===== */
.attachments-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.attachments-label {
  font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.attachment-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  background: var(--bg); border-radius: var(--radius-sm); font-size: 12px;
}
.attachment-preview { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.attachment-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); border-radius: 4px; font-size: 20px;
}
.attachment-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-remove { color: var(--danger); font-size: 14px; padding: 4px 8px; border-radius: 4px; }
.attachment-remove:hover { background: rgba(250,92,124,0.1); }
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; color: var(--text-muted); transition: all var(--transition);
}
.upload-btn:hover { border-color: var(--primary); color: var(--primary); }
.upload-btn input { display: none; }

/* ===== GLOBAL SEARCH DROPDOWN ===== */
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 500px; overflow-y: auto; z-index: 100;
}
.search-group { padding: 8px 0; }
.search-group:not(:last-child) { border-bottom: 1px solid var(--border); }
.search-group-title {
  padding: 6px 16px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
}
.search-result-item {
  padding: 8px 16px; cursor: pointer; display: flex; align-items: center;
  gap: 10px; transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg); }
.search-result-icon { font-size: 16px; }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-snippet {
  font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ===== SETTINGS & PROFILE ===== */
.settings-layout { display: flex; flex-direction: column; gap: 20px; max-width: 820px; }
.settings-section { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.settings-section-title {
  font-family: 'Rubik', sans-serif; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.settings-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.settings-toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border);
}
.settings-toggle-row:last-of-type { border-bottom: none; }
.settings-toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }
.settings-toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px;
  flex-shrink: 0; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border);
  border-radius: 24px; transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: white; border-radius: 50%;
  transition: transform var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked+.toggle-slider { background: var(--primary); }
.toggle-switch input:checked+.toggle-slider::before { transform: translateX(20px); }
.theme-switch-btns { display: flex; gap: 6px; }
.profile-avatar-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar svg { opacity: 0.4; }
.profile-avatar-actions { display: flex; gap: 8px; align-items: center; }

/* ===== HASHTAG SELECTION ===== */
.hashtag-tick { position: absolute; top: 10px; right: 10px; cursor: pointer; z-index: 2; }
.hashtag-tick-box {
  width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 4px;
  background: var(--bg-elevated); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); font-size: 11px;
}
.hashtag-tick-box.checked { background: var(--primary); border-color: var(--primary); color: white; }
.hashtag-tick-box:hover { border-color: var(--primary); }
.hashtag-selected { border-color: var(--primary) !important; box-shadow: 0 0 0 2px rgba(67,97,238,0.15) !important; }

/* ===== LANGUAGE SELECTOR - Duralux Style ===== */
.lang-selector-wrap { position: relative; }

.lang-trigger-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: all var(--transition); cursor: pointer; height: 36px;
}
.lang-trigger-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-trigger-btn.active { border-color: var(--primary); color: var(--primary); }
.lang-trigger-btn .fa-globe { font-size: 14px; color: var(--primary); }
.lang-current-label { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; }
.lang-arrow { font-size: 11px; transition: transform 0.2s; }
.lang-trigger-btn.active .lang-arrow { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 200; min-width: 195px; overflow: hidden;
  animation: fadeIn 0.15s ease;
}
.lang-dropdown-title {
  padding: 10px 14px 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.lang-list {
  display: flex; flex-direction: column; padding: 4px 0;
  max-height: 320px; overflow-y: auto;
}
.lang-item {
  padding: 8px 14px; font-size: 13px; text-align: left;
  transition: background var(--transition); color: var(--text);
  display: flex; align-items: center; gap: 8px; font-weight: 400;
}
.lang-item:hover { background: var(--bg); }
.lang-item.active { color: var(--primary); font-weight: 600; background: rgba(67,97,238,0.06); }

/* ===== RESPONSIVE - FIX #4: Tablet sidebar auto-hide ===== */
/* Mobile: hide sidebar off-screen */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    /* Ensure sidebar is completely hidden off-screen by default on mobile */
    width: var(--sidebar-width) !important;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  /* FIX #4: On mobile, main takes full width regardless of sidebar */
  .main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .page-container { padding: 16px; }
  .calendar-grid.week-view { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
  .cal-day { min-height: 70px; }
  .notif-dropdown { width: calc(100vw - 20px); right: 10px !important; }
}

/* FIX #4: Tablet mode (769px - 1024px) — sidebar starts as icon-only */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar:not(.open):not(.icon-only) {
    width: 62px;
  }
  .sidebar:not(.open):not(.icon-only) .logo-text,
  .sidebar:not(.open):not(.icon-only) .nav-label,
  .sidebar:not(.open):not(.icon-only) .nav-section-title {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .sidebar:not(.open):not(.icon-only) .sidebar-header {
    padding: 0;
    justify-content: center;
  }
  .sidebar:not(.open):not(.icon-only) .nav-item {
    padding: 10px 0;
    justify-content: center;
    border-left: none;
  }
  .sidebar:not(.open):not(.icon-only) .nav-item.active {
    border-left: none;
    border-right: 3px solid var(--primary);
  }
  .sidebar:not(.open):not(.icon-only) ~ .main {
    margin-left: 62px;
    width: calc(100% - 62px);
  }
}

@media (max-width: 1200px) {
  .kanban-board { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 600px) {
  .settings-field-grid { grid-template-columns: 1fr; }
  .settings-toggle-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== SIDEBAR TRANSITION ===== */
.sidebar { transition: width 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1); overflow: hidden; }
.main { transition: margin-left 0.25s cubic-bezier(.4,0,.2,1), width 0.25s cubic-bezier(.4,0,.2,1); }

/* ===== MISC ===== */
.stat-label { display: flex; align-items: center; gap: 6px; }
.section-title { display: flex; align-items: center; gap: 6px; }

/* Notification icon improvements */
.notif-icon .fa-info-circle { color: var(--info); }
.notif-icon .fa-check-circle { color: var(--success); }
.notif-icon .fa-clock-o { color: var(--warning); }
.notif-icon .fa-exclamation-triangle { color: var(--warning); }
.notif-icon .fa-times-circle { color: var(--danger); }

/* ===== FIX #2: Duralux-inspired typography refinements ===== */
h1, h2, h3 {
  font-family: 'Rubik', sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
}

/* Dashboard header matching Duralux style */
.dashboard-header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 3px;
}
.dashboard-header p {
  color: var(--text-muted);
  font-size: 13px;
}

/* FIX #2: Duralux stat value sizing */
.stat-value {
  font-family: 'Rubik', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.stat-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Section title Duralux style */
.section-title {
  font-family: 'Rubik', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

/* FIX #6: Modern outlined/line-style icon overrides for FA */
/* Use outlined variants where available */
.nav-item .fa-th-large::before { content: "\f009"; }
.nav-item .fa-file-text::before { content: "\f15c"; }
.nav-item .fa-calendar::before { content: "\f133"; }
.nav-item .fa-columns::before { content: "\f0db"; }
.nav-item .fa-hashtag::before { content: "\f292"; }
.nav-item .fa-link::before { content: "\f0c1"; }
.nav-item .fa-sticky-note::before { content: "\f249"; }
.nav-item .fa-user-circle::before { content: "\f2be"; }
.nav-item .fa-cog::before { content: "\f013"; }
