/* ================================================================
   STUDIO DESIGN — workflow v3
   Design System
================================================================ */

:root {
  --bg:        #f4f4f5;
  --surface:   #ffffff;
  --surface2:  #f0f0f1;
  --surface3:  #e4e4e6;
  --border:    #e0e0e3;
  --border2:   #c8c8cc;
  --text:      #0a0a0a;
  --text2:     #4a4a55;
  --text3:     #9090a0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow:    0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14), 0 4px 10px rgba(0,0,0,0.07);
  --radius:    9px;
  --radius-lg: 14px;
  --accent:    #0a0a0a;
  --accent-fg: #ffffff;
  --client-color: #0a0a0a;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-bounce: 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

[data-theme="dark"] {
  --bg:        #0c0c0e;
  --surface:   #141416;
  --surface2:  #1c1c20;
  --surface3:  #262630;
  --border:    #2c2c36;
  --border2:   #3c3c48;
  --text:      #f0f0f4;
  --text2:     #8a8a9a;
  --text3:     #52525e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 2px 8px rgba(0,0,0,0.5);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --accent:    #f0f0f4;
  --accent-fg: #0a0a0a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: 13px; }
input, select, textarea { font-family: inherit; font-size: 13px; }
img { max-width: 100%; display: block; }

/* SCROLLBARS — visíveis e contrastadas */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--surface2); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; border: 1px solid var(--surface2); }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* APP SHELL */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ——————————————————————————————
   HEADER
—————————————————————————————— */
.header {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  flex-shrink: 0;
  z-index: 30;
  gap: 0;
}

.logo-group {
  display: flex;
  align-items: center;
  padding-right: 18px;
  border-right: 1px solid var(--border);
  margin-right: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-img { height: 26px; width: auto; display: block; }
[data-theme="dark"] .logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: block !important; }
.logo-light { display: none !important; }
.logo-dark { display: block; }

/* GLOBAL SEARCH */
.global-search-wrap {
  position: relative;
  flex-shrink: 0;
}

.global-search-input {
  width: 260px;
  padding: 7px 12px 7px 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}
.global-search-input:focus {
  width: 320px;
  border-color: var(--border2);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.06);
}
[data-theme="dark"] .global-search-input:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
}
.global-search-input::placeholder { color: var(--text3); }
.global-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 14px;
  pointer-events: none;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}
.search-dropdown.open { display: block; }

.search-hint {
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}
.search-hint strong { color: var(--text2); }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface2); }

.search-result-type {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* NAV TABS */
.nav-tabs { display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  background: none;
  border: none;
  white-space: nowrap;
  transition: all var(--transition);
}
.nav-tab:hover { color: var(--text); background: var(--surface2); }
.nav-tab.active { color: var(--text); background: var(--surface2); font-weight: 600; }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* IMPORT BUTTON */
.import-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  transition: all var(--transition);
  white-space: nowrap;
}
.import-btn:hover { background: var(--surface3); border-color: var(--border2); color: var(--text); }

/* STAT ROW */
.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--surface2);
  border-radius: 20px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.stat-chip { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); }
.stat-chip-dot { width: 6px; height: 6px; border-radius: 50%; }

/* THEME BTN */
.theme-btn {
  width: 34px; height: 34px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text2);
  transition: all var(--transition);
}
.theme-btn:hover { border-color: var(--border2); }

/* USER MENU */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text2);
  transition: all var(--transition);
}
.user-btn:hover { border-color: var(--border2); }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 170px;
  z-index: 50;
  overflow: hidden;
  animation: fadeIn 0.15s ease;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--transition);
}
.user-dropdown-item:hover { background: var(--surface2); color: var(--text); }
.user-dropdown-item.danger { color: #dc2626; }
.user-dropdown-item + .user-dropdown-item { border-top: 1px solid var(--border); }

/* ——————————————————————————————
   TOOLBAR
—————————————————————————————— */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.toolbar::-webkit-scrollbar { display: none; }

.filter-sel {
  padding: 7px 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.filter-sel:focus { border-color: var(--border2); }
.toolbar-sep { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }

/* ——————————————————————————————
   BUTTONS
—————————————————————————————— */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface3); color: var(--text); border-color: var(--border2); }
.btn-ghost { background: none; color: var(--text3); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }
.btn-danger { background: rgba(220,38,38,0.08); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.btn-danger:hover { background: rgba(220,38,38,0.15); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; }

/* ——————————————————————————————
   LAYOUT
—————————————————————————————— */
.main-body { display: flex; flex: 1; overflow: hidden; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-section { padding: 14px 0 6px; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border); padding-top: 14px; }

.sidebar-label {
  padding: 0 16px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

.sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.sidebar-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-item.active { background: var(--surface2); color: var(--text); font-weight: 600; }

.sidebar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.sidebar-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text3);
  background: var(--surface3);
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sidebar-sub-item {
  padding: 4px 16px 4px 32px;
  font-size: 12px;
  color: var(--text3);
}
.sidebar-sub-item:hover { color: var(--text2); background: var(--surface2); }
.sidebar-sub-item.active { color: var(--text); font-weight: 600; }

.main-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; position: relative; }

.view-panel { display: none; flex: 1; overflow: hidden; animation: fadeIn 0.2s ease; }
.view-panel.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ——————————————————————————————
   FEED / HOME
—————————————————————————————— */
.feed-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.feed-compose {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.feed-compose-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.feed-compose-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  resize: none;
  outline: none;
  min-height: 60px;
  transition: border-color var(--transition);
  font-family: inherit;
  line-height: 1.5;
}
.feed-compose-input:focus { border-color: var(--border2); }
.feed-compose-input::placeholder { color: var(--text3); }

.feed-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.feed-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text2);
  transition: all var(--transition);
}
.feed-action-btn:hover { background: var(--surface2); border-color: var(--border2); }

.feed-post {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}
.feed-post:hover { box-shadow: var(--shadow-md); }

.feed-post.pinned {
  border-color: #d97706;
  box-shadow: 0 0 0 1px #d97706, var(--shadow);
}

.feed-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.feed-post-name { font-size: 13.5px; font-weight: 700; }
.feed-post-time { font-size: 11px; color: var(--text3); }

.feed-post-pin {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
  background: rgba(217,119,6,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.feed-post-body {
  padding: 0 16px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  margin-bottom: 4px;
}

.feed-post-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
}

.feed-react-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text3);
  cursor: pointer;
  transition: all var(--transition);
}
.feed-react-btn:hover { background: var(--surface2); border-color: var(--border); color: var(--text); }
.feed-react-btn.active { color: #2563eb; background: rgba(37,99,235,0.07); border-color: rgba(37,99,235,0.2); }

/* EMOJI PICKER */
.emoji-picker {
  display: none;
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 260px;
}
.emoji-picker.open { display: flex; }
.emoji-btn-item {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
  border: none;
  background: none;
}
.emoji-btn-item:hover { background: var(--surface2); }

/* ——————————————————————————————
   KANBAN
—————————————————————————————— */
.kanban-board {
  display: flex; gap: 12px;
  padding: 16px 18px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
}

.k-col { flex-shrink: 0; width: 276px; display: flex; flex-direction: column; max-height: 100%; }

.k-col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}
.k-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.k-col-title { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.k-col-count { margin-left: auto; font-size: 12px; color: var(--text3); }

.k-cards {
  flex: 1; overflow-y: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 7px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 80px;
}
.k-cards.drag-over { background: var(--surface3); border-color: var(--border2); }

/* CARD */
.k-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: var(--shadow-sm);
}
.k-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border2); }
.k-card.dragging { opacity: 0.45; transform: rotate(1.5deg) scale(0.97); box-shadow: var(--shadow-lg); }
.k-card.status-alteracao { border-left-color: #db2777 !important; background: rgba(219,39,119,0.03); }
[data-theme="dark"] .k-card.status-alteracao { background: rgba(219,39,119,0.07); }

.card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.card-body { padding: 10px 12px 9px; }

.card-meta { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.card-id { font-size: 10px; color: var(--text3); letter-spacing: 0.04em; font-weight: 500; }
.card-product {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 3px;
  background: var(--surface2); color: var(--text3);
  margin-left: auto; white-space: nowrap; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis;
}

.card-project {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--text2);
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-action {
  font-size: 13.5px; font-weight: 500;
  color: var(--text); line-height: 1.4;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }

.card-client-tag {
  font-size: 10.5px; color: var(--text3);
  border: 1px solid var(--border); padding: 2px 7px;
  border-radius: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}

.card-week {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  margin-top: 6px; display: inline-block;
}
.wk-esta    { background: rgba(37,99,235,0.1);  color: #2563eb; }
.wk-proxima { background: rgba(124,58,237,0.1); color: #7c3aed; }
.wk-atrasada{ background: rgba(220,38,38,0.1);  color: #dc2626; }

.card-featured-badge {
  font-size: 9.5px; font-weight: 700; color: #d97706;
  background: rgba(217,119,6,0.1);
  padding: 2px 6px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 5px;
}

/* Touch drag */
.k-card.touch-dragging {
  position: fixed; z-index: 200; pointer-events: none;
  transform: rotate(2deg) scale(1.04);
  box-shadow: var(--shadow-lg); opacity: 0.92; width: 250px;
}

/* ——————————————————————————————
   LISTA
—————————————————————————————— */
.list-scroll { flex: 1; overflow: auto; padding: 16px 18px; }

.list-tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }

.list-tbl th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 9px 11px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--text3); letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.list-tbl td { padding: 8px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list-tbl tr { cursor: pointer; transition: background var(--transition); }
.list-tbl tr:hover td { background: var(--surface2); }

.st-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap;
}

/* ——————————————————————————————
   POR CLIENTE
—————————————————————————————— */
.client-scroll { flex: 1; overflow: auto; padding: 16px 18px; }

.client-group { margin-bottom: 22px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }

.client-group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.client-group-head:hover { background: var(--surface2); }

.client-logo {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden;
}

.client-name { font-size: 14px; font-weight: 700; }
.client-meta { font-size: 11.5px; color: var(--text3); }
.client-tasks-count { margin-left: auto; font-size: 12px; color: var(--text3); }

.product-group { border-bottom: 1px solid var(--border); background: var(--surface); }
.product-group:last-child { border-bottom: none; }

.product-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--surface2); cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: var(--text2); letter-spacing: 0.04em; text-transform: uppercase;
  transition: background var(--transition);
  user-select: none;
}
.product-head:hover { background: var(--surface3); }
.product-arrow { font-size: 9px; color: var(--text3); transition: transform 0.2s ease; flex-shrink: 0; }
.product-arrow.open { transform: rotate(90deg); }

.product-tasks { display: none; }
.product-tasks.open { display: block; }

.pt-row {
  display: grid; grid-template-columns: 86px 108px 1fr 100px 88px;
  gap: 10px; padding: 7px 16px 7px 32px;
  border-top: 1px solid var(--border);
  cursor: pointer; align-items: center;
  transition: background var(--transition);
}
.pt-row:hover { background: var(--surface2); }

/* ——————————————————————————————
   GANTT
—————————————————————————————— */
.gantt-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 16px 18px; gap: 12px; }
.gantt-controls { display: flex; gap: 6px; flex-shrink: 0; }
.gantt-range-btn {
  padding: 6px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--text2);
  transition: all var(--transition);
}
.gantt-range-btn.active, .gantt-range-btn:hover { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

.gantt-scroll { flex: 1; overflow: auto; }

.gantt-tbl { border-collapse: collapse; font-size: 12.5px; min-width: 900px; width: 100%; }
.gantt-tbl th {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface);
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  padding: 8px 10px; font-size: 10px; font-weight: 700;
  color: var(--text3); letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; text-align: center;
}
.gantt-tbl th.s-left { position: sticky; left: 0; z-index: 4; text-align: left; min-width: 210px; }
.gantt-tbl td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; vertical-align: middle; }
.gantt-tbl td.s-left { position: sticky; left: 0; background: var(--surface); z-index: 2; border-right: 2px solid var(--border2); }
.gantt-tbl tr:hover td { background: var(--surface2); }
.gantt-tbl tr:hover td.s-left { background: var(--surface2); }

/* ——————————————————————————————
   MODAL
—————————————————————————————— */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.42);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 100; align-items: center; justify-content: center; padding: 16px;
}
.overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: modalIn 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex; align-items: flex-start;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border); gap: 12px; flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; flex: 1; line-height: 1.3; }
.modal-subtitle { font-size: 12px; color: var(--text3); margin-top: 2px; }
.modal-close {
  width: 28px; height: 28px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text2); flex-shrink: 0;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface3); }

.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* FORM */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }
.field-input, .field-select, .field-textarea {
  padding: 9px 11px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 13.5px;
  outline: none; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.05);
}
[data-theme="dark"] .field-input:focus, [data-theme="dark"] .field-select:focus { box-shadow: 0 0 0 3px rgba(255,255,255,0.05); }
.field-textarea { resize: vertical; min-height: 75px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--surface2); padding: 14px; border-radius: var(--radius); }
.dg-item { display: flex; flex-direction: column; gap: 3px; }
.dg-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; }
.dg-val { font-size: 13px; color: var(--text); font-weight: 500; }

/* COVER */
.cover-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; cursor: pointer;
  transition: all var(--transition);
}
.cover-upload-area:hover { border-color: var(--border2); background: var(--surface2); }
.cover-upload-area.has-image { padding: 0; border: none; border-radius: var(--radius); overflow: hidden; }
.cover-preview { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: var(--radius); }

/* IMPORT */
.import-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all var(--transition);
}
.import-drop-zone:hover, .import-drop-zone.drag-over { border-color: var(--border2); background: var(--surface2); }
.import-drop-zone h3 { font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.import-drop-zone p { font-size: 13px; color: var(--text3); }

/* ADMIN */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.page-title { font-size: 18px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text3); margin-top: 2px; }

.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; padding: 16px; overflow-y: auto; flex: 1;
}
.entity-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  cursor: pointer; transition: all var(--transition);
  display: flex; flex-direction: column; gap: 12px;
}
.entity-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border2); }
.entity-card-logo {
  width: 44px; height: 44px; border-radius: 10px;
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden;
}
.entity-card-name { font-size: 14px; font-weight: 700; }
.entity-card-meta { font-size: 12px; color: var(--text3); }

/* EMPTY */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 36px 20px;
  color: var(--text3); text-align: center; gap: 8px;
}
.empty-state-icon { font-size: 30px; opacity: 0.35; }
.empty-state-text { font-size: 13px; }

/* LOGIN */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 36px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.login-logo-img { height: 30px; width: auto; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0; font-size: 12px; color: var(--text3);
}
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* SPINNER */
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--text2); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading { display: flex; align-items: center; justify-content: center; flex: 1; gap: 10px; color: var(--text3); font-size: 13px; }

/* ——————————————————————————————
   MOBILE
—————————————————————————————— */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 40; padding: 6px 0 env(safe-area-inset-bottom);
}
.mobile-nav-inner { display: flex; justify-content: space-around; }
.mobile-nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 10px; background: none; border: none;
  color: var(--text3); font-size: 10.5px; font-family: inherit;
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; transition: color 0.15s; flex: 1;
}
.mobile-nav-btn.active { color: var(--text); }
.mobile-nav-icon { font-size: 20px; line-height: 1; }

@media (max-width: 768px) {
  .mobile-nav { display: block; }
  .main-content { padding-bottom: 64px; }
  .header .nav-tabs { display: none; }
  .sidebar { display: none !important; }
  .stat-row { display: none; }
  .header { padding: 0 14px; gap: 8px; }
  .logo-img { height: 22px; }
  .global-search-input { width: 160px; }
  .global-search-input:focus { width: 200px; }
  .import-btn span { display: none; }
  .field-row, .field-row3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; padding: 12px; }
  .k-col { width: 250px; }
  .kanban-board { padding: 12px 14px; gap: 10px; }
  .feed-wrap { padding: 14px; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}
