/* Shared LeadSoft proportions, based on CRM app.css and leadsoft-theme.css.
   Tasks keeps its purple accent and its own task-specific components. */
:root {
  --muted: #68717c;
  --line: #e4e7eb;
  --bg: #f5f6f8;
  --field: #fff;
  --shadow: 0 12px 32px rgba(16, 22, 31, .08);
  --radius: 16px;
  --sidebar: 238px;
}
:root[data-theme=dark] {
  --muted: #a6afbb;
  --line: #29313c;
  --bg: #0b0f15;
  --field: #0e141d;
  --shadow: 0 12px 34px rgba(0, 0, 0, .22);
}
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.eyebrow { font-weight: 800; letter-spacing: .12em; }
.button { min-height: 42px; padding: 0 17px; gap: 7px; font-size: 14px; font-weight: 750; line-height: 1.5; border-radius: 10px; }
.button.primary { box-shadow: 0 7px 18px var(--glow); }
.button.compact { min-height: 40px; padding: 0 14px; }
.button:hover { transform: translateY(-1px); }
.stack { gap: 14px; }
.field { font-size: 10px; font-weight: 750; color: #52635f; }
.field input, .field select, .field textarea { min-height: 42px; margin-top: 6px; padding: 10px 11px; border: 1px solid #dbe6e3; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.field input, .field select { height: 42px; }
.field textarea { line-height: 1.5; }
.field select { padding-right: 40px; }
.field input:focus, .field textarea:focus, .field select:focus, .quick-search input:focus { outline: 0; border-color: var(--primary-text); box-shadow: 0 0 0 3px var(--glow); }
:root[data-theme=dark] .field { color: var(--muted); }
:root[data-theme=dark] .field input, :root[data-theme=dark] .field textarea, :root[data-theme=dark] .field select { border-color: #303946; }
.form-panel { padding: 24px; max-width: 900px; }
.form-grid { gap: 15px; }
.form-actions { justify-content: flex-end; gap: 9px; }
.filters .field { font-size: 10px; }
.filters .field input, .filters .field select { height: 40px; min-height: 40px; font-size: 11px; }
.filters .button { font-size: 12px; }
.task-table th { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 12px 14px; background: #f9fbfa; }
.task-table td { padding: 13px 14px; font-size: 11px; }
:root[data-theme=dark] .task-table th { background: #18212c; color: #aeb7c3; }
.status { font-size: 9px; font-weight: 750; border-radius: 7px; padding: 5px 8px; }
.priority { font-size: 10px; }
.detail-panel { padding: 22px; }
.admin-grid { gap: 16px; max-width: 1000px; }
.projects-grid { gap: 16px; }

/* App shell and navigation. */
.sidebar { padding: 26px 16px 18px; background: radial-gradient(circle at 82% -5%, rgba(124, 58, 237, .16), transparent 32%), #0b0f15; }
.brand, .sidebar .brand { gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: -.025em; }
.brand img, .sidebar .brand img { display: block; width: 27px; height: 35px; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 27px; height: 35px; flex: 0 0 auto; }
.brand .brand-mark img { width: 100%; height: 100%; }
.brand b { font-weight: 700; }
.sidebar .brand b { color: var(--primary); }
.brand-stage { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border: 1px solid rgba(124, 58, 237, .7); border-radius: 999px; color: var(--primary-text); background: rgba(124, 58, 237, .11); font-size: 9px; font-weight: 800; letter-spacing: .1em; line-height: 1; }
.sidebar .brand--stage { position: relative; }
.sidebar .brand-stage { position: absolute; top: 100%; left: 50%; margin-top: 3px; transform: translateX(-50%); color: #bd9bff; }
.main-nav { margin-top: 30px; gap: 6px; }
.brand-link:has(.brand--stage) + .main-nav { margin-top: 53px; }
.nav-item { min-height: 44px; padding: 0 12px; gap: 10px; border-radius: 10px; }
.nav-item .icon { width: 22px; height: 22px; padding: 2px; }
.nav-item.active { background: rgba(124, 58, 237, .16); box-shadow: inset 2px 0 0 var(--primary); }
.sidebar .theme-toggle { gap: 7px; min-height: 36px; padding: 0 10px; }
.sidebar-bottom { padding: 32px 8px 0; }
.sidebar-user { padding: 16px 0 0; border-top-color: rgba(255, 255, 255, .1); }
.sidebar-user small { max-width: 160px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; color: #97a2b0; }
.sidebar .avatar { background: #252d38; color: #fff; font-weight: 800; }
.sidebar-bottom > form { margin-top: 14px; }
.logout { min-height: 34px; gap: 7px; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); color: #b8c0cb; font-weight: 700; }
.logout:hover { border-color: var(--primary); background: rgba(124, 58, 237, .1); }
.topbar { height: 72px; min-height: 72px; padding: 0 30px; gap: 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.quick-search input { border-color: transparent; background: #f3f6f5; }
:root[data-theme=dark] .quick-search input { border-color: #303946; background: #151d27; }
.topbar-context { flex-direction: row; gap: 10px; align-items: baseline; }
.topbar-context__date { font-size: 14px; }
.topbar-context__time { font-size: 18px; }
.content { max-width: 1480px; padding: 30px 34px 72px; }
.page-heading h1 { font-size: 30px; line-height: 1.14; font-weight: 700; margin: 3px 0 7px; letter-spacing: -.035em; }
.page-heading p { font-size: 14px; }
.bottom-nav { display: none; }

/* Login uses the same card dimensions and spacing as CRM. */
.auth-page { padding: 24px; background: radial-gradient(circle at 70% 15%, #e9dbff 0, transparent 31%), linear-gradient(145deg, #fcfaff, #f2f4f7); }
.auth-shell { max-width: 430px; margin: 0; }
.auth-card { padding: 34px; border: 1px solid #e3e6ea; border-radius: 20px; box-shadow: 0 25px 60px rgba(18, 24, 33, .12); }
.auth-card .brand { font-size: 18px; margin-bottom: 30px; }
.auth-card .brand-mark { width: 32px; height: 42px; }
.auth-card .brand .brand-mark img { width: 100%; height: 100%; }
.auth-heading { margin: 0 0 24px; }
.auth-heading h1 { font-size: 27px; font-weight: 700; line-height: 1.5; letter-spacing: normal; margin: 4px 0; }
.auth-heading p { font-size: 11px; margin: 0; }
.auth-card .field { display: block; font: inherit; color: var(--ink); }
.auth-card .field > span:first-child { display: block; font-size: 10px; font-weight: 750; color: #52635f; margin-bottom: 6px; }
.auth-card .field input { height: 42px; min-height: 42px; margin-top: 0; font-size: 12px; padding: 10px 11px; }
.auth-card .field > input:first-child, .auth-card .field > input:not(:nth-child(2)) { margin-top: 6px; }
.auth-card .button.primary { min-height: 42px; font-size: 14px; margin-top: 0; border-radius: 10px; }
.auth-note { color: #8a9995; font-size: 9px; margin: 20px 0 0; }
:root[data-theme=dark] .auth-page { background: radial-gradient(circle at 70% 15%, rgba(124, 58, 237, .18) 0, transparent 31%), #090d13; }
:root[data-theme=dark] .auth-card { border-color: var(--line); }
:root[data-theme=dark] .auth-card .field > span:first-child { color: var(--muted); }

@media (max-width: 1100px) { .topbar-context { display: none; } }
@media (max-width: 780px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { margin-left: 0; }
  .menu-button { display: inline-grid; color: var(--primary-text); }
  .topbar { height: 62px; min-height: 62px; padding: 0 14px; gap: 10px; }
  .topbar > .button { width: 40px; padding: 0; }
  .topbar > .button > span { display: none; }
  .quick-search input { height: 38px; font-size: 14px; padding-left: 42px; }
  .quick-search .icon { left: 14px; top: 10px; width: 18px; height: 18px; }
  .content { padding: 20px 14px calc(128px + env(safe-area-inset-bottom)); }
  .page-heading h1 { font-size: 25px; }
  .form-panel { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .task-table td { padding: 8px; }
  .sidebar .theme-toggle { margin-top: 14px; font-size: 11px; }
  .bottom-nav { position: fixed; z-index: 40; left: 8px; right: 8px; bottom: 8px; min-height: 62px; padding: 6px; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; gap: 1px; border-radius: 10px; color: var(--muted); }
  .bottom-nav a.active { background: var(--soft); color: var(--primary-text); }
  .bottom-nav .icon { width: 18px; height: 18px; }
  .bottom-nav small { font-size: 8px; font-weight: 700; }
  .bottom-user-avatar { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #252d38; color: #fff; font-size: 9px; font-weight: 800; }
  :root[data-theme=dark] .bottom-nav { background: rgba(18, 25, 34, .97); }
}
@media (max-width: 480px) {
  .auth-card { padding: 27px 22px; }
  .auth-card .brand { gap: 6px; }
  .brand-stage { font-size: 8px; padding: 0 5px; }
  .auth-note { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .button:hover { transform: none; } }

/* Attachment selection is a separate component, not a fixed-height text field. */
.attachment-picker { min-width: 0; }
.attachment-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.file-dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; min-height: 116px; padding: 20px; border: 1px dashed var(--line); border-radius: 12px; background: var(--field); transition: background-color .15s, border-color .15s, box-shadow .15s; }
.file-dropzone.is-dragover { border-color: var(--primary-text); background: var(--soft); box-shadow: 0 0 0 3px var(--glow); }
.file-dropzone:focus-within { border-color: var(--primary-text); }
.file-drop-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; color: var(--primary-text); background: var(--soft); border-radius: 10px; }
.file-drop-icon .icon { width: 20px; height: 20px; }
.file-drop-copy { flex: 1 1 150px; min-width: 0; }
.file-drop-copy strong { display: block; font-size: 13px; font-weight: 700; }
.file-drop-copy > span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.file-drop-copy { display: none; }
.is-enhanced .file-drop-copy { display: block; }
.file-browse, .upload-form .file-browse { flex: 0 0 auto; min-height: 38px; margin: 0; padding: 0 14px; font-size: 12px; }
.file-picker-input { display: block; min-width: 0; width: 100%; max-width: 100%; height: auto; padding: 0; border: 0; font-size: 12px; }
.file-picker-input::file-selector-button { margin: 0 12px 0 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--primary-text); font: inherit; cursor: pointer; }
.is-enhanced .file-picker-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.file-help { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.selected-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; }
.selected-files > li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); }
.selected-file-info { flex: 1; min-width: 0; }
.selected-file-info strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.selected-file-info small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.file-remove { flex: 0 0 auto; min-height: 34px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.file-remove:hover { background: var(--danger-soft); color: var(--danger); }
.attachment-picker .file-feedback { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.attachment-picker .file-feedback.is-error { color: var(--danger); }
.detail-side .file-dropzone { justify-content: center; text-align: center; padding: 18px 14px; }
.detail-side .file-drop-copy { flex-basis: 100%; }
.detail-side .file-browse { width: 100%; }
@media (max-width: 480px) {
  .file-dropzone { padding: 16px; gap: 12px; }
  .file-browse, .upload-form .file-browse { width: 100%; min-height: 42px; }
  .file-remove { min-height: 42px; }
}
