@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/plex-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/plex-arabic-500.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/plex-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/plex-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/plex-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/plex-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/plex-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --navy: #0b1f3a;
  --navy-2: #13294d;
  --navy-3: #1d3a66;
  --gold: #c9a227;
  --gold-soft: #f6efd6;
  --bg: #f4f6fa;
  --line: #e4e8f0;
  --muted: #6b7489;
  --ink: #1a2233;
  --sidebar-w: 248px;
  --bs-body-font-family: 'Plex Arabic', Tahoma, system-ui, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-primary: #1d4e8f;
  --bs-primary-rgb: 29, 78, 143;
  --bs-link-color: #1d4e8f;
  --bs-link-color-rgb: 29, 78, 143;
  --bs-link-hover-color: var(--navy);
}
body { font-size: .94rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.small-xs { font-size: .78rem; }
.fw-semibold { font-weight: 600 !important; }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--navy); color: #c8d1e3; display: flex; flex-direction: column; z-index: 1030;
  border-left: 1px solid rgba(255,255,255,.04);
}
.sidebar .brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.15rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--navy-3); display: grid; place-items: center; border: 1.5px solid var(--gold); flex-shrink: 0; }
.brand-mark img { width: 24px; height: 24px; }
.sidebar .brand-name { font-weight: 700; font-size: .98rem; line-height: 1.2; }
.sidebar .brand-sub { font-size: .72rem; color: var(--gold); letter-spacing: .02em; }
.sidebar nav { padding: .8rem .65rem; overflow-y: auto; flex: 1; }
.sidebar .nav-section { font-size: .7rem; color: #7d8aa5; padding: .9rem .7rem .35rem; font-weight: 600; }
.sidebar .nav-link { color: #c8d1e3; border-radius: 9px; padding: .55rem .75rem; display: flex; align-items: center; gap: .65rem; font-weight: 500; margin-bottom: 2px; }
.sidebar .nav-link i { font-size: 1.05rem; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: linear-gradient(90deg, rgba(201,162,39,.08), rgba(201,162,39,.2)); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.sidebar .nav-link.active i { color: var(--gold); opacity: 1; }
.sidebar .nav-link .badge { margin-inline-start: auto; }
.sidebar .side-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .78rem; color: #7d8aa5; }
.sidebar .side-foot a { color: #b7c2d8; }

.main { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: .6rem 1.4rem; display: flex; align-items: center; gap: .75rem; min-height: 60px; }
.topbar h1 { font-size: 1.12rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 1.4rem; flex: 1; max-width: 1500px; width: 100%; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,.25); }
  .main { margin-right: 0; }
  .content { padding: 1rem .85rem; }
  .topbar { padding: .55rem .85rem; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(11,31,58,.45); z-index: 1025; display: none; }
  .sidebar-backdrop.show { display: block; }
}

/* ===== Company switcher ===== */
.company-switch { border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: .85rem; padding: .32rem 2rem .32rem .7rem; max-width: 190px; }

/* ===== Buttons ===== */
.btn { border-radius: 9px; font-weight: 500; }
.btn-gold { background: var(--gold); color: var(--navy); border: 1px solid var(--gold); font-weight: 600; }
.btn-gold:hover, .btn-gold:focus { background: #b8921c; border-color: #b8921c; color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.btn-navy:hover { background: var(--navy-3); color: #fff; }
.btn-light { background: #fff; border-color: var(--line); }
.btn-light:hover { background: #f0f3f8; border-color: #d5dbe6; }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; position: relative; }
.btn-icon .dot { position: absolute; top: -6px; left: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d64545; color: #fff; font-size: .66rem; line-height: 17px; font-weight: 700; }

/* ===== Cards ===== */
.card { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: .85rem 1.1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.card-header .sub { font-weight: 400; color: var(--muted); font-size: .82rem; }
.card-body { padding: 1.1rem; }

.stat { padding: 1rem 1.1rem; display: flex; gap: .85rem; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.stat .num { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .82rem; }
.ico-navy { background: #e7edf7; color: var(--navy-3); }
.ico-red { background: #fdecec; color: #c53030; }
.ico-gold { background: var(--gold-soft); color: #8a6d1d; }
.ico-green { background: #e6f5ee; color: #23784f; }
.ico-violet { background: #efe9fb; color: #6b46c1; }
a.stat-link { color: inherit; display: block; }
a.stat-link .card { transition: border-color .15s, transform .15s; }
a.stat-link:hover .card { border-color: #c9d2e3; transform: translateY(-1px); }

/* ===== Task rows ===== */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); color: inherit; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fafbfd; }
.task-row .t-title { font-weight: 600; color: var(--ink); line-height: 1.45; }
.task-row .t-meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem .75rem; margin-top: 2px; }
.task-row .t-meta i { margin-inline-end: 2px; }
.prio-bar { width: 4px; align-self: stretch; border-radius: 4px; flex-shrink: 0; }
.prio-urgent { background: #d64545; } .prio-high { background: #e0a526; } .prio-normal { background: #8fb3e3; } .prio-low { background: #d0d6e0; }

.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .18rem .55rem; border-radius: 20px; white-space: nowrap; }
.chip-status-new { background: #eef1f6; color: #4a5568; }
.chip-status-in_progress { background: #e5efff; color: #1d4e8f; }
.chip-status-review { background: #fff4d9; color: #8a5a00; }
.chip-status-done { background: #e3f5ea; color: #1f7a4a; }
.chip-status-cancelled { background: #ececec; color: #555; text-decoration: line-through; }
.chip-prio-urgent { background: #fdecec; color: #c53030; }
.chip-prio-high { background: #fff3e0; color: #a35f00; }
.chip-prio-normal { background: #eaf2fc; color: #2c5d99; }
.chip-prio-low { background: #f1f3f6; color: #6b7489; }
.chip-company { background: #f0f2f7; color: var(--navy-2); }
.chip-source { background: var(--gold-soft); color: #7a5f12; }
.dot-color { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.avatar { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 24px; height: 24px; font-size: .62rem; }
.avatar-lg { width: 42px; height: 42px; font-size: .9rem; }
.avatar-empty { background: #e7eaf0 !important; color: #8a93a6; border: 1px dashed #b9c1cf; }

.progress-thin { height: 6px; border-radius: 6px; background: #edf0f5; }
.progress-thin .progress-bar { background: var(--gold); border-radius: 6px; }

/* ===== Filters ===== */
.filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters .form-select, .filters .form-control { font-size: .85rem; border-radius: 9px; width: auto; min-width: 130px; }
.filters .search { min-width: 200px; flex: 1; }
.tabs-pill { display: flex; gap: .35rem; flex-wrap: wrap; }
.tabs-pill a { padding: .35rem .8rem; border-radius: 20px; color: var(--muted); font-size: .85rem; font-weight: 500; border: 1px solid transparent; }
.tabs-pill a.active { background: var(--navy); color: #fff; }
.tabs-pill a:not(.active):hover { background: #fff; border-color: var(--line); color: var(--ink); }

/* ===== Kanban ===== */
.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.board-col { background: #eaeef5; border-radius: 14px; padding: .65rem; min-height: 200px; }
.board-col-head { display: flex; align-items: center; gap: .5rem; padding: .25rem .4rem .7rem; font-weight: 700; font-size: .92rem; }
.board-col-head .count { background: #fff; color: var(--muted); border-radius: 20px; padding: 0 .55rem; font-size: .78rem; font-weight: 600; }
.board-list { min-height: 120px; display: flex; flex-direction: column; gap: .55rem; }
.kcard { background: #fff; border-radius: 11px; padding: .7rem .8rem; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16,24,40,.04); cursor: grab; position: relative; color: inherit; display: block; }
.kcard:hover { border-color: #c9d2e3; }
.kcard.locked { cursor: default; }
.kcard .k-title { font-weight: 600; line-height: 1.45; margin-bottom: .45rem; font-size: .9rem; color: var(--ink); }
.kcard .k-foot { display: flex; align-items: center; gap: .5rem; font-size: .76rem; color: var(--muted); }
.kcard .k-prio { position: absolute; top: 0; right: 0; width: 100%; height: 3px; border-radius: 11px 11px 0 0; }
.sortable-ghost { opacity: .4; }
.sortable-chosen { box-shadow: 0 10px 25px rgba(11,31,58,.18); }
@media (max-width: 991.98px) { .board { grid-template-columns: repeat(4, 82vw); } }

/* ===== Task page ===== */
.task-head h2 { font-size: 1.35rem; font-weight: 700; line-height: 1.5; }
.meta-list { list-style: none; padding: 0; margin: 0; }
.meta-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.meta-list li:last-child { border-bottom: 0; }
.meta-list .k { color: var(--muted); white-space: nowrap; }
.meta-list .form-select, .meta-list .form-control { font-size: .85rem; border-radius: 8px; max-width: 190px; }
.desc { white-space: normal; line-height: 1.9; }
.check-item { display: flex; align-items: center; gap: .6rem; padding: .45rem .3rem; border-radius: 8px; }
.check-item:hover { background: #f7f9fc; }
.check-item .form-check-input { width: 1.2rem; height: 1.2rem; margin: 0; cursor: pointer; flex-shrink: 0; }
.check-item .form-check-input:checked { background-color: #23784f; border-color: #23784f; }
.check-item.done .txt { text-decoration: line-through; color: var(--muted); }
.check-item .del { opacity: 0; transition: opacity .15s; }
.check-item:hover .del { opacity: 1; }
.comment { display: flex; gap: .7rem; margin-bottom: 1rem; }
.comment .bubble { background: #f6f8fb; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: .65rem .85rem; flex: 1; }
.comment .who { font-weight: 600; font-size: .85rem; }
.comment .when { font-size: .74rem; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 1.1rem .8rem 0; font-size: .82rem; color: #4a5568; }
.timeline li::before { content: ''; position: absolute; right: 3px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #c3cad8; }
.timeline li::after { content: ''; position: absolute; right: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: .74rem; }
.file-item { display: flex; align-items: center; gap: .65rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); }
.file-item:last-child { border-bottom: 0; }
.file-item .ext { width: 36px; height: 36px; border-radius: 9px; background: #eef2f8; display: grid; place-items: center; color: var(--navy-3); font-size: 1.1rem; }

/* ===== Forms ===== */
.form-control, .form-select { border-radius: 9px; border-color: #d9dfe9; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(201,162,39,.18); }
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .3rem; }
.form-text { font-size: .78rem; }
.prio-picker { display: flex; gap: .4rem; flex-wrap: wrap; }
.prio-picker input { display: none; }
.prio-picker label { border: 1px solid var(--line); border-radius: 9px; padding: .4rem .85rem; cursor: pointer; font-size: .85rem; font-weight: 500; background: #fff; }
.prio-picker input:checked + label { border-color: var(--navy); background: var(--navy); color: #fff; }

.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-color: var(--line); vertical-align: middle; }
.table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; background: #fafbfd; white-space: nowrap; }

.empty { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }
.empty i { font-size: 2.2rem; color: #c3cad8; display: block; margin-bottom: .5rem; }

.alert { border-radius: 11px; }
.dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: 0 12px 30px rgba(16,24,40,.12); font-size: .9rem; }
.notif-menu { width: 340px; max-width: 92vw; padding: 0; }
.notif-menu .n-item { display: block; padding: .65rem .9rem; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .85rem; }
.notif-menu .n-item.unread { background: #fffbea; }
.notif-menu .n-item:hover { background: #f5f7fb; }

code.k { background: #0b1f3a; color: #f6efd6; padding: .15rem .45rem; border-radius: 6px; direction: ltr; display: inline-block; }
pre.code { background: #0b1f3a; color: #e6edf7; padding: 1rem; border-radius: 12px; direction: ltr; text-align: left; font-size: .8rem; overflow-x: auto; }

/* ===== Auth ===== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(circle at 20% 20%, #1d3a66 0, var(--navy) 55%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(201,162,39,.25); left: -120px; bottom: -120px; box-shadow: 0 0 0 40px rgba(201,162,39,.04), 0 0 0 90px rgba(201,162,39,.03); }
.auth-side h2 { font-weight: 700; font-size: 2rem; line-height: 1.5; }
.auth-side .gold { color: var(--gold); }
.auth-side ul { list-style: none; padding: 0; color: #c8d1e3; }
.auth-side li { margin-bottom: .6rem; display: flex; gap: .55rem; align-items: center; }
.auth-side li i { color: var(--gold); }
.auth-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form .form-control { padding: .7rem .9rem; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-form { background: var(--bg); } .auth-form .box { background: #fff; padding: 1.6rem; border-radius: 16px; border: 1px solid var(--line); } }

.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.section-title { font-weight: 700; font-size: 1rem; margin-bottom: .75rem; }

.form-control::placeholder { color: #a3abbb; }
