/* =====================================================================
   RAW STUDIO Portal — design system
   ===================================================================== */
:root {
  --accent: #E8442A;
  --accent-2: #ff6a4d;
  --accent-soft: rgba(232, 68, 42, .12);
  --accent-line: rgba(232, 68, 42, .35);
  --bg: #101010;
  --bg-2: #191919;
  --bg-3: #1f1f1f;
  --bg-4: #262626;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f1f1f1;
  --text-2: #c9c9c9;
  --muted: #8d8d8d;
  --green: #3ecf8e; --blue: #5b9dff; --amber: #f5a524; --red: #f0544f; --violet: #a78bfa; --slate: #a1a1aa;
  --radius: 10px;
  --radius-lg: 14px;
  --sb-w: 248px;
  --sb-w-c: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, kbd, pre { font-family: var(--mono); font-size: 12.5px; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-green { color: var(--green); } .text-accent { color: var(--accent); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.pad { padding: 16px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-lg { margin-top: 24px; }
.hidden { display: none !important; }
.small { font-size: 12.5px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sb-w); flex: none; background: #0b0b0b; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: width .25s var(--ease); z-index: 40;
}
.sb-head { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.sb-brand { display: flex; align-items: center; }
.sb-logo { height: 22px; display: block; }
.sb-mark { height: 26px; display: none; }
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.sb-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5f5f5f; padding: 16px 10px 6px; font-weight: 600; white-space: nowrap; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  position: relative; transition: background .15s, color .15s; white-space: nowrap; margin: 1px 0;
}
.sb-link:hover { background: rgba(255, 255, 255, .045); color: #fff; }
.sb-link.active { background: var(--accent-soft); color: #fff; }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sb-link.active .ic { color: var(--accent); }
.sb-count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 0 7px; line-height: 18px; }
.sb-foot { border-top: 1px solid var(--line); padding: 10px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.sb-user:hover { background: rgba(255, 255, 255, .045); }
.sb-user .sb-label { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sb-user strong { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.sb-user small { color: var(--muted); font-size: 11.5px; }
.sb-label { overflow: hidden; text-overflow: ellipsis; }

body.sb-collapsed .sidebar { width: var(--sb-w-c); }
body.sb-collapsed .sb-label, body.sb-collapsed .sb-section, body.sb-collapsed .sb-logo { display: none; }
body.sb-collapsed .sb-mark { display: block; }
body.sb-collapsed .sb-head { padding: 0; flex-direction: column; justify-content: center; height: 96px; gap: 8px; }
body.sb-collapsed .sb-link { justify-content: center; padding: 10px; }
body.sb-collapsed .sb-count { position: absolute; top: 2px; right: 4px; padding: 0 5px; font-size: 10px; line-height: 15px; }
body.sb-collapsed .sb-user { justify-content: center; }
body.sb-collapsed .sb-section + .sb-link { margin-top: 12px; }
.sb-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(16, 16, 16, .82); backdrop-filter: blur(14px); z-index: 30;
}
.search { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; height: 36px; width: min(440px, 100%); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .ic { color: var(--muted); width: 16px; }
.search input { background: none !important; border: 0 !important; box-shadow: none !important; outline: 0; color: var(--text); flex: 1; font: inherit; min-width: 0; height: 34px; padding: 0; }
.search kbd { color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; font-size: 11px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 28px 28px 60px; max-width: 1480px; width: 100%; animation: fadeUp .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.crumbs a:hover { color: var(--text); }
.crumbs .ic { width: 13px; height: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--text); font: 500 13.5px var(--font); cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--bg-4); border-color: rgba(255, 255, 255, .18); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 20px -8px rgba(232, 68, 42, .6); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-danger { background: rgba(240, 84, 79, .12); border-color: rgba(240, 84, 79, .4); color: #ff8a86; }
.btn-danger:hover { background: rgba(240, 84, 79, .2); color: #fff; border-color: var(--red); }
.btn-success { background: rgba(62, 207, 142, .12); border-color: rgba(62, 207, 142, .4); color: #6fe3ae; }
.btn-success:hover { background: rgba(62, 207, 142, .2); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; position: relative; transition: background .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.dot-count { position: absolute; top: 3px; right: 2px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 16px; border: 2px solid var(--bg); }
.user-btn { display: flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 30px; }
.user-btn:hover { background: rgba(255, 255, 255, .06); }
.clock-form { margin: 0; }
.clocked { border-color: rgba(62, 207, 142, .35); color: #9ee8c3; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(62, 207, 142, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(62, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); } }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 20px; }
.chip .ic { width: 14px; height: 14px; color: var(--green); }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #171717; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .7); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98);
  transition: opacity .15s, transform .15s var(--ease), visibility .15s; z-index: 60;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu form > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--text-2); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu form > button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.dropdown-menu .ic { width: 16px; height: 16px; }
.dropdown-menu form { margin: 0; }
.dm-user { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.dm-user small { color: var(--muted); }
.notif-menu { width: 380px; padding: 0; }
.dm-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dm-head form > button { width: auto; padding: 0; color: var(--accent); }
.dm-head form > button:hover { background: none; text-decoration: underline; }
.dm-foot { justify-content: center; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px !important; font-size: 12.5px; }
.notif-list { max-height: 380px; overflow-y: auto; }

/* ---------- Cards & grids ---------- */
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--muted); width: 17px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 280px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.stat {
  background: linear-gradient(180deg, #1b1b1b, #171717); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px;
  position: relative; overflow: hidden; transition: border-color .2s, transform .2s var(--ease); display: block;
}
a.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.stat-ic .ic { width: 16px; height: 16px; color: var(--text-2); }
.stat.accent .stat-ic { background: var(--accent-soft); border-color: var(--accent-line); }
.stat.accent .stat-ic .ic { color: var(--accent); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; }
.stat-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.stat::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.035), transparent 70%); }
.stat.accent::after { background: radial-gradient(circle, rgba(232,68,42,.12), transparent 70%); }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; margin-bottom: 18px; background:
  radial-gradient(600px 200px at 0% 0%, rgba(232, 68, 42, .16), transparent 60%), linear-gradient(180deg, #1a1a1a, #151515); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.welcome h2 { font-size: 22px; }
.welcome p { color: var(--text-2); margin: 6px 0 0; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); transition: background .12s; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, .list-item.hover:hover { background: rgba(255, 255, 255, .025); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-item .li-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-item.unread { background: rgba(232, 68, 42, .045); }
.list-item.unread .li-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.li-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-3); border: 1px solid var(--line); flex: none; }
.li-ic .ic { width: 16px; height: 16px; color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255,255,255,.012); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .022); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-user { display: flex; align-items: center; gap: 10px; }
.table .cell-user strong { font-weight: 500; display: block; }
.table .cell-user small { color: var(--muted); }
.table a.row-link { font-weight: 500; }
.table a.row-link:hover { color: var(--accent-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); }

/* ---------- Badges / avatars / progress ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 6px; border: 1px solid; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--green); background: rgba(62, 207, 142, .08); border-color: rgba(62, 207, 142, .25); }
.badge-blue { color: var(--blue); background: rgba(91, 157, 255, .08); border-color: rgba(91, 157, 255, .25); }
.badge-amber { color: var(--amber); background: rgba(245, 165, 36, .08); border-color: rgba(245, 165, 36, .25); }
.badge-red { color: var(--red); background: rgba(240, 84, 79, .08); border-color: rgba(240, 84, 79, .25); }
.badge-violet { color: var(--violet); background: rgba(167, 139, 250, .08); border-color: rgba(167, 139, 250, .25); }
.badge-slate { color: var(--slate); background: rgba(161, 161, 170, .07); border-color: rgba(161, 161, 170, .2); }
.badge-muted { color: #777; background: transparent; border-color: rgba(255, 255, 255, .08); }
.badge-accent { color: #ff7c63; background: var(--accent-soft); border-color: var(--accent-line); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; flex: none; object-fit: cover; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 10) 55% 42%), hsl(calc(var(--h, 10) + 40) 55% 30%)); border: 1px solid rgba(255,255,255,.08); }
.avatar-xs { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
.avatar-empty { background: var(--bg-4); color: var(--muted); }
.avatars { display: flex; }
.avatars .avatar { margin-left: -7px; border: 2px solid var(--bg-2); }
.avatars .avatar:first-child { margin-left: 0; }
.progress { height: 6px; background: rgba(255, 255, 255, .07); border-radius: 6px; overflow: hidden; min-width: 60px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width .6s var(--ease); }
.progress.green span { background: var(--green); }
.progress.amber span { background: var(--amber); }
.progress.red span { background: var(--red); }
.progress.lg { height: 10px; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
.req::after { content: " *"; color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=tel], input:not([type]), select, textarea {
  background: #141414; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; height: 38px; padding: 0 12px; font: inherit; width: 100%;
  transition: border-color .15s, box-shadow .15s; outline: 0;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
select[multiple] { height: auto; min-height: 140px; background-image: none; padding: 6px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.7); }
input[type=file] { color: var(--muted); font: inherit; font-size: 13px; }
input[type=file]::file-selector-button { background: var(--bg-4); color: var(--text); border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 12px; margin-right: 10px; cursor: pointer; font: inherit; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 150px; height: 34px; }
.filters .search-in { min-width: 240px; }
.inline-form { display: inline; margin: 0; }

.dropzone { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; display: block; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone .ic { width: 28px; height: 28px; color: var(--text-2); margin-bottom: 6px; }
.dropzone input { display: none; }
.dz-files { margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.upload-progress { margin-top: 10px; display: none; }
.upload-progress.show { display: block; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; border: 1px solid; margin-bottom: 16px; font-size: 13.5px; animation: fadeUp .3s var(--ease); }
.alert-success { background: rgba(62, 207, 142, .08); border-color: rgba(62, 207, 142, .3); color: #a7f0cd; }
.alert-error { background: rgba(240, 84, 79, .08); border-color: rgba(240, 84, 79, .3); color: #ffb3b0; }
.alert-info { background: rgba(91, 157, 255, .08); border-color: rgba(91, 157, 255, .3); color: #bcd5ff; }
.alert-warning { background: rgba(245, 165, 36, .08); border-color: rgba(245, 165, 36, .3); color: #fbd38d; }
.alert-x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; padding: 0; }
.alert-x .ic { width: 15px; height: 15px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
.tab .ic { width: 15px; height: 15px; }
.tab .n { background: var(--bg-4); border-radius: 10px; padding: 0 7px; font-size: 11.5px; color: var(--text-2); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 6px; color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.seg a.active { background: var(--bg-4); color: #fff; }
.seg .ic { width: 15px; height: 15px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kb-col { background: #141414; border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 300px; }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.kb-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kb-head .n { color: var(--muted); font-weight: 500; margin-left: auto; font-size: 12px; background: var(--bg-3); padding: 0 8px; border-radius: 10px; }
.kb-list { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 120px; transition: background .15s; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kb-list.over { background: var(--accent-soft); }
.kb-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: grab; transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; display: block; }
.kb-card:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(0,0,0,.6); }
.kb-card.dragging { opacity: .45; }
.kb-card .kb-title { font-weight: 500; margin-bottom: 4px; line-height: 1.35; }
.kb-card .kb-proj { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; display: block; }
.kb-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.kb-meta .grow { display: flex; gap: 6px; align-items: center; }
.kb-meta .ic { width: 13px; height: 13px; }

/* ---------- Files ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file-tile { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s var(--ease); position: relative; }
.file-tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.file-tile .ft-ic { height: 74px; border-radius: 9px; background: var(--bg-3); display: grid; place-items: center; overflow: hidden; }
.file-tile .ft-ic img { width: 100%; height: 100%; object-fit: cover; }
.file-tile .ft-ic .ic { width: 30px; height: 30px; color: var(--text-2); }
.file-tile.folder .ft-ic .ic { color: var(--accent); }
.file-tile .ft-name { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-tile .ft-meta { font-size: 11.5px; color: var(--muted); }
.kind-image { color: #7cc4ff !important; } .kind-video { color: #c79bff !important; } .kind-audio { color: #63e6be !important; } .kind-pdf { color: #ff8a80 !important; } .kind-archive { color: #ffd166 !important; } .kind-design { color: #5bc0eb !important; } .kind-project { color: #f78c6b !important; }
.preview-box { background: #0c0c0c; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; min-height: 300px; overflow: hidden; }
.preview-box img, .preview-box video { max-width: 100%; max-height: 70vh; display: block; }
.preview-box audio { width: 90%; }
.preview-box iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.preview-box pre { width: 100%; max-height: 70vh; overflow: auto; margin: 0; padding: 18px; color: var(--text-2); white-space: pre-wrap; }
.folder-tree { list-style: none; margin: 0; padding: 0; }
.folder-tree ul { list-style: none; margin: 0; padding-left: 14px; border-left: 1px solid var(--line); margin-left: 15px; }
.folder-tree a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.folder-tree a:hover { background: rgba(255, 255, 255, .045); color: #fff; }
.folder-tree a.active { background: var(--accent-soft); color: #fff; }
.folder-tree .ic { width: 15px; height: 15px; color: var(--muted); }
.folder-tree a.active .ic { color: var(--accent); }

/* ---------- Detail / meta ---------- */
.meta-list { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 13.5px; margin: 0; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.prose { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.comment .c-head small { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg-4); border: 2px solid #3a3a3a; }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.ok::before { border-color: var(--green); background: rgba(62,207,142,.3); }
.timeline li.bad::before { border-color: var(--red); background: rgba(240,84,79,.3); }
.timeline small { color: var(--muted); display: block; }

.profile-hero { display: flex; align-items: center; gap: 20px; padding: 24px; }
.profile-hero h2 { font-size: 22px; }
.profile-hero p { margin: 4px 0 0; color: var(--muted); }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.staff-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; text-align: center; transition: border-color .15s, transform .15s var(--ease); display: block; }
.staff-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.staff-card .avatar { margin: 0 auto 12px; }
.staff-card h4 { font-size: 14.5px; }
.staff-card p { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }

.project-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, transform .15s var(--ease); }
.project-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.project-card .pc-code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.project-card h3 { font-size: 15.5px; line-height: 1.3; }
.project-card .pc-client { color: var(--muted); font-size: 12.5px; }
.project-card .pc-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }

.meter { display: flex; flex-direction: column; gap: 8px; }
.meter-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.meter-row strong { color: var(--text); font-weight: 500; }

.announcement { padding: 18px; border-bottom: 1px solid var(--line); }
.announcement:last-child { border-bottom: 0; }
.announcement h4 { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.announcement .a-meta { color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; display: flex; gap: 10px; align-items: center; }
.announcement.pinned { background: linear-gradient(90deg, rgba(232,68,42,.06), transparent 60%); }
.announcement.unread h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: #4a4a4a; margin-bottom: 10px; }
.empty h4 { color: var(--text-2); font-size: 14.5px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; }
.pager-btns { display: flex; gap: 6px; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
.chart .axis { fill: #777; font-size: 11px; font-family: var(--font); }
.chart .bar-a { fill: var(--accent); }
.chart .bar-b { fill: #5a5a5a; }
.chart .bar-g { fill: var(--green); }
.chart .bar-r { fill: var(--red); }
.chart rect:hover { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; font-size: 13px; padding: 6px 0; }
.hbar .progress { height: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .d { aspect-ratio: 1.6; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line); padding: 6px 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; justify-content: space-between; }
.cal .d.present { background: rgba(62,207,142,.1); border-color: rgba(62,207,142,.25); color: #a7f0cd; }
.cal .d.late { background: rgba(245,165,36,.1); border-color: rgba(245,165,36,.25); color: #fbd38d; }
.cal .d.leave { background: rgba(91,157,255,.1); border-color: rgba(91,157,255,.25); color: #bcd5ff; }
.cal .d.absent { background: rgba(240,84,79,.08); border-color: rgba(240,84,79,.22); color: #ffb3b0; }
.cal .d.half_day { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.25); }
.cal .d.off { opacity: .4; }
.cal .d.blank { visibility: hidden; }
.cal .dow { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal .d.today { outline: 1.5px solid var(--accent); }

.health { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.health:last-child { border-bottom: 0; }
.health .hd { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hd.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(62,207,142,.15); }
.hd.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,165,36,.15); }
.hd.fail { background: var(--red); box-shadow: 0 0 0 3px rgba(240,84,79,.15); }
.log-view { background: #0b0b0b; border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 520px; overflow: auto; font-family: var(--mono); font-size: 12px; color: #bdbdbd; white-space: pre-wrap; word-break: break-all; margin: 0; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-2); }
.perm-matrix .mod-row td { background: rgba(255,255,255,.02); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fadeIn .15s; }
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { background: #171717; border: 1px solid var(--line-2); border-radius: 16px; padding: 24px; width: min(440px, 100%); box-shadow: 0 30px 80px -20px #000; animation: fadeUp .2s var(--ease); }
.modal-card.wide { width: min(640px, 100%); }
.modal-card h3 { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Auth ---------- */
.auth-body { background: var(--bg); min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; background:
  radial-gradient(900px 500px at 10% 0%, rgba(232, 68, 42, .28), transparent 60%),
  radial-gradient(700px 500px at 100% 100%, rgba(232, 68, 42, .12), transparent 60%), #0b0b0b; border-right: 1px solid var(--line); display: flex; align-items: flex-end; padding: 56px; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(180deg, #000 20%, transparent 90%); }
.auth-art-inner { position: relative; max-width: 480px; }
.auth-logo { height: 34px; margin-bottom: 36px; }
.auth-art h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 14px; }
.auth-art p { color: var(--text-2); font-size: 15px; line-height: 1.6; }
.auth-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 34px; max-width: 300px; }
.auth-grid span { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); }
.auth-grid span:nth-child(1) { background: var(--accent); }
.auth-grid span:nth-child(2) { background: rgba(232,68,42,.55); }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 24px; }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; animation: fadeUp .4s var(--ease); }
.auth-card h1 { font-size: 26px; }
.auth-card .muted { margin: -8px 0 4px; }
.auth-card .alert { margin: 0; }
.auth-logo-sm { height: 22px; display: none; align-self: flex-start; margin-bottom: 10px; }
.auth-foot { text-align: center; font-size: 13px; margin: 0; }
.auth-foot a { color: var(--accent); }
.auth-copy { color: #555; font-size: 12px; }
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 12px; }
.error-code { font-size: 96px; font-weight: 700; letter-spacing: -.05em; background: linear-gradient(180deg, var(--accent), #6b1b0f); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.error-page p { color: var(--muted); max-width: 440px; }

.mobile-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s var(--ease); width: var(--sb-w) !important; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  body.sb-collapsed .sb-label, body.sb-collapsed .sb-section, body.sb-collapsed .sb-logo { display: revert; }
  body.sb-collapsed .sb-mark { display: none; }
  .sb-toggle { display: none; }
  .mobile-only { display: inline-grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 20px 14px 50px; }
  .g2, .g3, .g-side { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-logo-sm { display: block; }
  .clock-form .btn { padding: 0 8px; }
  .search kbd { display: none; }
  .hbar { grid-template-columns: 100px 1fr 80px; }
  .meta-list { grid-template-columns: 110px 1fr; }
}
@media (max-width: 600px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .clock-form { display: none; }
  .notif-menu { width: calc(100vw - 28px); right: -50px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Fixes ---------- */
.filters select { max-width: 240px; }
.filters input[type=checkbox], .check input[type=checkbox], input[type=checkbox], input[type=radio] { min-width: 0 !important; width: 16px !important; height: 16px !important; padding: 0; flex: none; accent-color: var(--accent); }
.kb-meta { flex-wrap: wrap; row-gap: 6px; }
.kb-meta .grow { flex-wrap: wrap; }
.kb-meta > .small { margin-left: auto; white-space: nowrap; }
input[type=range] { padding: 0; border: 0; box-shadow: none !important; background: none; height: 24px; }
input[type=month] { background: #141414; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; height: 34px; padding: 0 12px; font: inherit; }
input[type=month]::-webkit-calendar-picker-indicator { filter: invert(.7); }
.kb-meta .grow { flex: 1 1 auto; min-width: auto; }

/* ---------- Chunked uploader ---------- */
.uploader .dropzone { cursor: default; }
.uploader .dropzone label.btn { cursor: pointer; }
.up-summary { margin-top: 12px; }
.up-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.up-row { display: grid; grid-template-columns: 1fr 90px 110px; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.up-row:last-child { border-bottom: 0; }
.up-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row .st { text-align: right; color: var(--muted); }
.up-row.done .st { color: var(--green); }
.up-row.err .st { color: var(--red); }
.up-row.err .nm { color: #ffb3b0; }
.up-row.active { background: var(--accent-soft); }
.dropzone .btn .ic { width: 16px; height: 16px; margin: 0; color: inherit; }
.table td.actions { display: table-cell; text-align: right; white-space: nowrap; }
.table td.actions > * { display: inline-flex; vertical-align: middle; margin-left: 6px; }
.table td.actions > form { margin: 0 0 0 6px; }
.small .ic, .li-sub .ic { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- Quotation / invoice editor ---------- */
.items-editor td { vertical-align: top; padding: 8px 10px; }
.items-editor input { height: 34px; }
.items-editor .item-details { min-height: 0; height: 30px; margin-top: 6px; font-size: 12.5px; color: var(--text-2); resize: vertical; padding: 6px 10px; }
.items-editor input.right, .totals-editor input.right { text-align: right; }
.items-editor [data-amount] { padding-top: 16px; font-weight: 500; }
.items-editor .actions { white-space: nowrap; }
.items-editor .icon-btn { width: 28px; height: 28px; }
.ic.rot90 { transform: rotate(90deg); }
.items-editor.no-qty .qty-col { display: none; }
.totals-editor { display: flex; flex-direction: column; gap: 12px; }
.totals-editor .meter-row { align-items: center; font-size: 14px; }
.totals-editor .grand { border-top: 1px solid var(--accent-line); padding-top: 12px; font-size: 17px; }
.totals-editor .grand strong { color: var(--accent-2); }
.doc-preview { width: 100%; height: 82vh; border: 1px solid var(--line); border-radius: 12px; background: #18181b; }
