@font-face {
  font-family: Plex;
  src: url('/fonts/plex-arabic.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
:root {
  --bg: #f5f5f0;
  --paper: #fff;
  --ink: #173337;
  --muted: #6b7b7e;
  --line: #dfe5e1;
  --brand: #13695f;
  --accent: #c6a15b;
  --wash: #edf3ef;
  --danger: #a23e37;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Plex, 'Segoe UI', sans-serif;
  line-height: 1.7;
}
body.dark {
  --bg: #132326;
  --paper: #1b3033;
  --ink: #edf5ee;
  --muted: #a8babb;
  --line: #345052;
  --wash: #263e3d;
  --brand: #74c6b4;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 17px;
  background: var(--paper);
  color: var(--ink);
  transition: background 0.15s;
}
button:hover {
  background: var(--wash);
}
button.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
button.accent {
  background: var(--brand);
  color: var(--paper);
  border-color: var(--brand);
}
button.danger {
  color: var(--danger);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}
textarea {
  min-height: 95px;
  resize: vertical;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  line-height: 1.5;
  font-weight: 500;
}
h2 {
  font-size: 1.25rem;
  font-weight: 500;
}
h3 {
  font-size: 1.02rem;
}
small,
.muted {
  color: var(--muted);
}
.loading {
  padding: 15vh;
  text-align: center;
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #112d31;
  color: #eaf0ec;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-family: 'Segoe UI', sans-serif;
  font-size: 26px;
  letter-spacing: 5px;
  line-height: 1.3;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid #bfa46a;
  color: #d9ba76;
  border-radius: 50%;
  font-family: Georgia, serif;
  letter-spacing: 0;
  font-size: 23px;
  margin-inline-end: 8px;
}
.brand small {
  font-family: Plex, sans-serif;
  letter-spacing: 0;
  font-size: 11px;
  display: block;
  color: #a4bab7;
  margin-top: 12px;
}
.org {
  font-size: 10px;
  letter-spacing: 3px;
  color: #d1b679;
  border-top: 1px solid #365053;
  padding-top: 23px;
  margin-top: 28px;
}
.nav {
  margin-top: 18px;
  display: grid;
  gap: 5px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #bfcfcc;
  padding: 10px 13px;
  border-radius: 7px;
  font-size: 0.9rem;
}
.nav a.active {
  background: #29464a;
  color: #fff;
  border-inline-start: 3px solid #d1b679;
}
.nav a:hover {
  text-decoration: none;
  background: #203f42;
}
.nav-icon {
  font-family:
    Segoe UI,
    sans-serif;
  font-size: 19px;
  width: 22px;
  text-align: center;
}
.profile {
  margin-top: auto;
  border-top: 1px solid #365053;
  padding-top: 20px;
  font-size: 12px;
  color: #bdd0cb;
}
.profile strong {
  display: block;
  color: #fff;
  font-weight: 400;
  font-size: 14px;
}
.profile button {
  margin-top: 12px;
  background: transparent;
  border-color: #41615e;
  color: #d0ded8;
  font-size: 11px;
  padding: 4px 12px;
}
.workspace {
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  background: var(--paper);
}
.topbar small {
  font-size: 12px;
}
.topbar .actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #409987;
  margin-inline-end: 5px;
}
.dot.off {
  background: #bc864a;
}
.page {
  max-width: 1500px;
  margin: auto;
  padding: 32px 40px 60px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.page-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.page-heading h1 {
  margin-bottom: 6px;
}
.hero {
  padding: 27px 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-inline-start: 4px solid var(--accent);
  margin-bottom: 25px;
}
.hero h2 {
  margin-bottom: 7px;
}
.hero p {
  font-size: 0.88rem;
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 19px 22px;
}
.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-family: 'Segoe UI', sans-serif;
  font-size: 32px;
  font-weight: 400;
  margin-top: 5px;
}
.stat.warn strong {
  color: var(--danger);
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr);
  gap: 24px;
}
.panel {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 20px;
  min-width: 0;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.panel-title h2 {
  margin: 0;
}
.panel-title a {
  font-size: 0.8rem;
}
.task-row {
  display: flex;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding: 17px 0;
  cursor: pointer;
}
.task-row:first-child {
  border-top: 0;
}
.task-row .task-main {
  flex: 1;
  min-width: 0;
}
.task-title {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 4px;
}
.priority {
  width: 4px;
  min-height: 38px;
  border-radius: 5px;
  background: #b3c6c0;
  align-self: stretch;
}
.priority.high {
  background: #c7a058;
}
.priority.urgent {
  background: #b56356;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--wash);
  color: var(--brand);
  font-size: 11px;
}
.badge.waiting_reply,
.badge.waiting_approval {
  background: #f7efdc;
  color: #8d691d;
}
.badge.cancelled {
  background: #eeefed;
  color: #647574;
}
.badge.completed {
  background: #e5f2e9;
  color: #27744b;
}
.empty {
  text-align: center;
  padding: 35px 15px;
  color: var(--muted);
  font-size: 0.9rem;
}
.empty-symbol {
  font-family: Georgia, serif;
  font-size: 42px;
  color: #abbdb4;
  display: block;
  margin-bottom: 6px;
}
.empty strong {
  font-weight: 400;
  display: block;
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 5px;
}
.focus-card {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.focus-card p {
  font-size: 0.84rem;
  margin: 5px 0;
}
.focus-card small {
  font-size: 0.75rem;
}
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.table-wrap {
  overflow: auto;
}
.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.task-table th {
  text-align: start;
  color: var(--muted);
  font-weight: 400;
  background: var(--wash);
  padding: 13px;
}
.task-table td {
  border-bottom: 1px solid var(--line);
  padding: 16px 13px;
}
.task-table tr[data-task] {
  cursor: pointer;
}
.task-table tr[data-task]:hover {
  background: var(--wash);
}
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 16px;
}
.lane {
  background: var(--wash);
  padding: 15px;
  border-radius: 10px;
}
.lane h3 {
  display: flex;
  justify-content: space-between;
}
.task-card {
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  cursor: pointer;
}
.task-card p {
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.task-card small {
  font-size: 0.72rem;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
}
.day {
  min-height: 115px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
  min-width: 0;
}
.day.head {
  min-height: 35px;
  background: var(--wash);
  text-align: center;
  font-size: 12px;
}
.day.today {
  background: var(--wash);
}
.day a {
  display: block;
  background: var(--paper);
  border-inline-start: 2px solid var(--brand);
  border-radius: 3px;
  padding: 3px 5px;
  margin-top: 5px;
  font-size: 10px;
  overflow-wrap: anywhere;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 5px;
  align-content: start;
  font-size: 0.85rem;
}
.field.full {
  grid-column: 1/-1;
}
.check {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 0.85rem;
}
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.helper {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 3px 0 0;
}
.notice {
  border-inline-start: 3px solid var(--accent);
  background: var(--wash);
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.error {
  color: var(--danger);
  white-space: pre-wrap;
}
dialog {
  width: min(780px, calc(100% - 24px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 28px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop {
  background: #0f292b99;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-head button {
  padding: 2px 12px;
}
.timeline {
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 18px;
  margin-top: 16px;
}
.event {
  margin: 0 0 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}
.event small {
  display: block;
}
.steps {
  display: grid;
  gap: 10px;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
}
.step input[type='text'] {
  flex: 1;
}
.step button {
  padding: 4px 10px;
}
.file-list {
  display: grid;
  gap: 5px;
  margin: 10px 0;
}
.file-list a {
  font-size: 0.85rem;
}
.chatbox {
  min-height: 350px;
  max-height: 55vh;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 5px;
}
.bubble {
  padding: 16px 20px;
  background: var(--wash);
  border-radius: 10px;
  max-width: 90%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}
.bubble.user {
  background: var(--ink);
  color: var(--paper);
  justify-self: start;
}
.bubble.agent {
  justify-self: end;
}
.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}
.chat-input textarea {
  min-height: 70px;
}
.integration {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.integration strong {
  font-size: 0.95rem;
}
.integration p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 5px 0 0;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-art {
  background: #112d31;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12%;
  position: relative;
  overflow: hidden;
}
.auth-art:after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border: 1px solid #395555;
  border-radius: 50%;
  bottom: -370px;
  left: -150px;
  box-shadow:
    0 0 0 80px #18373a,
    0 0 0 81px #29474a;
}
.auth-art h1 {
  font-size: 2.5rem;
  margin-top: 65px;
  max-width: 450px;
}
.auth-art p {
  color: #b7cdc8;
  font-size: 1rem;
  max-width: 400px;
}
.auth-form {
  padding: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-form form {
  width: 100%;
  max-width: 400px;
}
.auth-form .field {
  margin-bottom: 17px;
}
.auth-form button {
  width: 100%;
  margin-top: 10px;
}
.auth-form .org {
  color: var(--muted);
  border: 0;
}
.auth-form h2 {
  font-size: 1.8rem;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 550px;
  margin: auto;
  padding: 13px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 9px;
  box-shadow: 0 4px 25px #0002;
  z-index: 99;
  display: none;
}
.stack {
  display: grid;
  gap: 20px;
}
.approval-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--wash);
  padding: 15px;
  border-radius: 8px;
}
.report-list {
  padding-inline-start: 20px;
  font-size: 0.9rem;
}
.progress {
  font-size: 0.75rem;
  color: var(--muted);
}
.flex {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.topbar .mobile-brand {
  display: none;
}
.wide {
  grid-column: 1/-1;
}
.notification {
  padding: 17px;
  border-bottom: 1px solid var(--line);
}
.notification p {
  margin: 4px 0;
}
.notification small {
  font-size: 0.75rem;
}
.notification.unread {
  border-inline-start: 3px solid var(--brand);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  direction: ltr;
  text-align: left;
}
@media (min-width: 1500px) {
  .board {
    grid-template-columns: repeat(6, minmax(160px, 1fr));
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .page {
    padding: 25px;
  }
  .topbar {
    padding: 16px 25px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .sidebar {
    padding: 26px 14px;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 0;
    background: #112d31;
  }
  .sidebar > .brand,
  .sidebar > .org,
  .sidebar > .profile {
    display: none;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    margin: 0;
    padding: 8px;
    gap: 4px;
  }
  .nav a {
    white-space: nowrap;
    padding: 8px 10px;
    gap: 5px;
    font-size: 12px;
  }
  .nav-icon {
    font-size: 16px;
    width: 18px;
  }
  .nav a.active {
    border-inline-start: 0;
    border-bottom: 2px solid var(--accent);
  }
  .topbar {
    padding: 13px 16px;
    gap: 8px;
  }
  .topbar .mobile-brand {
    display: block;
    font-size: 15px;
    letter-spacing: 2px;
  }
  .topbar small {
    display: none;
  }
  .topbar .actions {
    gap: 7px;
  }
  .topbar button {
    font-size: 12px;
    padding: 7px 10px;
  }
  .page {
    padding: 23px 16px 50px;
  }
  .page-heading h1 {
    font-size: 1.65rem;
  }
  .page-heading {
    gap: 10px;
  }
  .page-heading button {
    font-size: 12px;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .page-heading p {
    font-size: 0.8rem;
  }
  .hero {
    padding: 20px;
    grid-template-columns: 1fr;
  }
  .hero button {
    justify-self: start;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 13px 17px;
  }
  .stat strong {
    font-size: 26px;
  }
  .panel {
    padding: 18px;
  }
  .task-row {
    gap: 9px;
  }
  .task-row .badge {
    font-size: 9px;
  }
  .task-title {
    font-size: 0.85rem;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters input {
    grid-column: 1/-1;
  }
  .filters select {
    font-size: 12px;
  }
  .board {
    grid-template-columns: 1fr;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .calendar {
    min-width: 550px;
  }
  .calendar-scroll {
    overflow: auto;
  }
  .day {
    min-height: 95px;
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 32px 26px;
    min-height: 240px;
  }
  .auth-art h1 {
    font-size: 1.7rem;
    margin-top: 24px;
  }
  .auth-art p {
    font-size: 0.9rem;
    margin: 0;
  }
  .auth-art:after {
    display: none;
  }
  .auth-form {
    padding: 30px 25px;
  }
  .auth-form h2 {
    font-size: 1.5rem;
  }
  .chat-input {
    display: grid;
  }
  .chat-input button {
    justify-self: end;
  }
  .bubble {
    max-width: 100%;
    font-size: 0.85rem;
  }
  dialog {
    padding: 19px;
  }
  .integration {
    align-items: flex-start;
  }
  .task-table th,
  .task-table td {
    padding: 10px;
    white-space: nowrap;
  }
  .task-table td:first-child {
    white-space: normal;
    min-width: 170px;
  }
}
