/* ============================================================
   ORBICS — Corporate Design System
   public_html/assets/css/orbics.css

   Brand Palette:
     Deep Espresso   #4B2E2B  (primary)
     Warm Chestnut   #8C5A3C  (secondary)
     Golden Bronze   #C08552  (accent)
     Warm Cream      #FFF8F0  (surface/bg)

   Typography:
     Display/Headings: EB Garamond
     All UI:           Arial, sans-serif
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  /* Brand */
  --clr-primary:        #4B2E2B;
  --clr-primary-dark:   #3A2220;
  --clr-primary-light:  #6B3E3A;
  --clr-secondary:      #8C5A3C;
  --clr-accent:         #C08552;
  --clr-accent-light:   #D4A574;
  --clr-accent-dim:     #E8C9A8;
  --clr-surface:        #FFF8F0;

  /* Backgrounds */
  --bg-page:            #F5EDE3;
  --bg-card:            #FFFFFF;
  --bg-sidebar:         #4B2E2B;
  --bg-header:          #FFFFFF;
  --bg-hover:           #FAF0E6;
  --bg-selected:        #FFF0DF;
  --bg-input:           #FFFFFF;

  /* Text */
  --txt-primary:        #2C1810;
  --txt-secondary:      #6B4D3E;
  --txt-muted:          #9C7B6B;
  --txt-placeholder:    #B8967A;
  --txt-on-dark:        #FFF8F0;
  --txt-on-accent:      #FFFFFF;
  --txt-sidebar:        #F5E6D8;
  --txt-sidebar-muted:  #B8967A;

  /* Borders */
  --bdr-light:          #EAD9CA;
  --bdr-medium:         #D4BEA8;
  --bdr-strong:         #B8967A;
  --bdr-sidebar:        rgba(255,248,240,0.1);

  /* Status */
  --clr-success:        #2D6A4F;
  --clr-success-bg:     #D8F3DC;
  --clr-success-bdr:    #95D5B2;
  --clr-warning:        #965A00;
  --clr-warning-bg:     #FFF3CD;
  --clr-warning-bdr:    #FFD166;
  --clr-danger:         #8B1A1A;
  --clr-danger-bg:      #FDEAEA;
  --clr-danger-bdr:     #F4A3A3;
  --clr-info:           #1A4A6B;
  --clr-info-bg:        #E3F2FD;
  --clr-info-bdr:       #90CAF9;

  /* Priority */
  --priority-critical:  #8B1A1A;
  --priority-high:      #C05621;
  --priority-medium:    #965A00;
  --priority-low:       #2D6A4F;

  /* Task Status */
  --status-todo:        #6B5E52;
  --status-progress:    #1A4A6B;
  --status-review:      #5B2D8B;
  --status-blocked:     #8B1A1A;
  --status-done:        #2D6A4F;
  --status-cancelled:   #9C7B6B;

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-7:  28px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Radius */
  --rad-sm: 3px;
  --rad-md: 6px;
  --rad-lg: 8px;
  --rad-xl: 12px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(75,46,43,0.06);
  --shadow-sm:  0 1px 4px rgba(75,46,43,0.10);
  --shadow-md:  0 2px 8px rgba(75,46,43,0.12);
  --shadow-lg:  0 4px 16px rgba(75,46,43,0.14);

  /* Sidebar */
  --sidebar-w:        240px;
  --sidebar-w-collapsed: 60px;
  --header-h:         56px;

  /* Transitions */
  --t-fast:   120ms ease;
  --t-normal: 200ms ease;
  --t-slow:   300ms ease;

  /* Font stacks */
  --font-ui:      Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --font-display: 'EB Garamond', Georgia, serif;

  /* Font sizes */
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   16px;
  --fs-xl:   18px;
  --fs-2xl:  20px;
  --fs-3xl:  24px;
  --fs-4xl:  28px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  color: var(--txt-primary);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; color: var(--clr-secondary); }

img { max-width: 100%; height: auto; display: block; }

button, input, select, textarea {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
}

/* ── Layout Shell ─────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  color: var(--txt-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--t-slow);
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: var(--bdr-sidebar) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,248,240,0.15); border-radius: 4px; }

.sidebar-logo {
  padding: 18px var(--sp-5);
  border-bottom: 1px solid var(--bdr-sidebar);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.sidebar-logo img,
.sidebar-logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #FFF8F0;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sidebar-section {
  padding: var(--sp-5) 0 var(--sp-2);
}

.sidebar-section-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt-sidebar-muted);
  padding: 0 var(--sp-5) var(--sp-2);
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-5);
  color: var(--txt-sidebar);
  font-size: var(--fs-sm);
  font-weight: 400;
  border-radius: 0;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(255,248,240,0.08);
  color: #FFFFFF;
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(192,133,82,0.18);
  color: var(--clr-accent-light);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--clr-accent);
  border-radius: 0 2px 2px 0;
}

.sidebar-link .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.sidebar-link.active .nav-icon,
.sidebar-link:hover .nav-icon {
  opacity: 1;
}

.sidebar-link .nav-badge {
  margin-left: auto;
  background: var(--clr-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  background: var(--bdr-sidebar);
  margin: var(--sp-3) var(--sp-5);
}

.sidebar-user {
  margin-top: auto;
  border-top: 1px solid var(--bdr-sidebar);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--clr-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--txt-sidebar);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--fs-xs);
  color: var(--txt-sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Content Area ────────────────────────────────────── */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Header / Top Bar ─────────────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
}

.header-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--txt-primary);
  flex: 1;
}

.header-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-page);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-md);
  padding: 6px var(--sp-3);
  width: 240px;
  transition: border-color var(--t-fast), width var(--t-normal);
}

.header-search:focus-within {
  border-color: var(--clr-accent);
  width: 300px;
}

.header-search-icon {
  color: var(--txt-muted);
  flex-shrink: 0;
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--fs-sm);
  color: var(--txt-primary);
  width: 100%;
}

.header-search input::placeholder {
  color: var(--txt-placeholder);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.header-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--bdr-light);
  background: transparent;
  border-radius: var(--rad-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--txt-secondary);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  position: relative;
}

.header-btn:hover {
  background: var(--bg-hover);
  border-color: var(--bdr-medium);
  color: var(--txt-primary);
}

.header-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--clr-accent);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: var(--sp-6);
  max-width: 1600px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
  flex: 1;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 500;
  color: var(--clr-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--txt-muted);
  margin-top: var(--sp-1);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--txt-muted);
  margin-bottom: var(--sp-4);
}

.breadcrumb a {
  color: var(--txt-muted);
}
.breadcrumb a:hover { color: var(--clr-accent); }

.breadcrumb-sep {
  color: var(--bdr-medium);
  font-size: var(--fs-xs);
}

.breadcrumb-current {
  color: var(--txt-secondary);
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-4);
  border-radius: var(--rad-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  text-decoration: none !important;
  line-height: 1.4;
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--clr-primary);
  color: var(--txt-on-dark);
  border-color: var(--clr-primary);
}
.btn-primary:hover {
  background: var(--clr-primary-dark);
  border-color: var(--clr-primary-dark);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--txt-on-dark);
}

.btn-accent {
  background: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}
.btn-accent:hover {
  background: var(--clr-secondary);
  border-color: var(--clr-secondary);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--txt-secondary);
  border-color: var(--bdr-medium);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--bdr-strong);
  color: var(--txt-primary);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--txt-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--txt-primary);
  text-decoration: none;
}

.btn-danger {
  background: var(--clr-danger);
  color: #fff;
  border-color: var(--clr-danger);
}
.btn-danger:hover {
  background: #6B0F0F;
  border-color: #6B0F0F;
  color: #fff;
  text-decoration: none;
}

.btn-sm {
  padding: 4px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.btn-lg {
  padding: 10px var(--sp-6);
  font-size: var(--fs-md);
}

.btn-icon {
  padding: 7px;
  min-width: 32px;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--txt-secondary);
  margin-bottom: var(--sp-2);
}

.form-label .required {
  color: var(--clr-danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 8px var(--sp-3);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-md);
  background: var(--bg-input);
  color: var(--txt-primary);
  font-size: var(--fs-base);
  font-family: var(--font-ui);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px rgba(192,133,82,0.15);
}

.form-control::placeholder { color: var(--txt-placeholder); }

.form-control:disabled, .form-control[readonly] {
  background: var(--bg-page);
  color: var(--txt-muted);
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239C7B6B'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  appearance: none;
}

.form-hint {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
  margin-top: var(--sp-1);
}

.form-error {
  font-size: var(--fs-xs);
  color: var(--clr-danger);
  margin-top: var(--sp-1);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.form-row {
  display: grid;
  gap: var(--sp-4);
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-divider {
  border: none;
  border-top: 1px solid var(--bdr-light);
  margin: var(--sp-6) 0;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  overflow: hidden;
}

.card-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--txt-primary);
}

.card-body {
  padding: var(--sp-5);
}

.card-footer {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--bdr-light);
  background: var(--bg-page);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  background: var(--bg-card);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

table.data-table thead {
  background: var(--bg-page);
  border-bottom: 1px solid var(--bdr-medium);
}

table.data-table th {
  padding: 10px var(--sp-4);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--txt-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--bdr-medium);
}

table.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}
table.data-table th.sortable:hover { color: var(--txt-primary); }

table.data-table td {
  padding: 11px var(--sp-4);
  border-bottom: 1px solid var(--bdr-light);
  color: var(--txt-primary);
  vertical-align: middle;
}

table.data-table tbody tr:last-child td { border-bottom: none; }

table.data-table tbody tr:hover { background: var(--bg-hover); }

table.data-table tbody tr.selected { background: var(--bg-selected); }

.td-muted { color: var(--txt-muted); }
.td-mono  { font-family: 'Courier New', monospace; font-size: var(--fs-xs); }
.td-bold  { font-weight: 600; }
.td-right { text-align: right; }
.td-center{ text-align: center; }

/* ── Filters / Toolbar ────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--bdr-light);
  background: var(--bg-card);
  flex-wrap: wrap;
}

.filter-control {
  padding: 5px var(--sp-3);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-md);
  background: var(--bg-page);
  color: var(--txt-primary);
  font-size: var(--fs-sm);
  font-family: var(--font-ui);
  min-width: 120px;
  transition: border-color var(--t-fast);
}

.filter-control:focus {
  outline: none;
  border-color: var(--clr-accent);
}

.filters-bar .filter-sep {
  color: var(--bdr-medium);
  font-size: var(--fs-xl);
  line-height: 1;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-md);
  background: var(--bg-page);
  padding: 5px var(--sp-3);
}

.filter-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--fs-sm);
  color: var(--txt-primary);
  width: 180px;
}

.filter-search input::placeholder { color: var(--txt-placeholder); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--bdr-light);
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-link {
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--txt-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  text-decoration: none;
}

.tab-link:hover {
  color: var(--txt-primary);
  text-decoration: none;
}

.tab-link.active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── KPI Metric Blocks ────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.kpi-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--txt-muted);
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--txt-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-change {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.kpi-change.up   { color: var(--clr-success); }
.kpi-change.down { color: var(--clr-danger); }

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--rad-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-primary  { background: rgba(75,46,43,0.10); color: var(--clr-primary); }
.kpi-icon-accent   { background: rgba(192,133,82,0.15); color: var(--clr-accent); }
.kpi-icon-success  { background: var(--clr-success-bg); color: var(--clr-success); }
.kpi-icon-warning  { background: var(--clr-warning-bg); color: var(--clr-warning); }
.kpi-icon-danger   { background: var(--clr-danger-bg); color: var(--clr-danger); }
.kpi-icon-info     { background: var(--clr-info-bg); color: var(--clr-info); }

/* ── Badges / Pills ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

/* Status badges */
.badge-todo       { background: rgba(107,94,82,0.12); color: var(--status-todo); }
.badge-progress   { background: rgba(26,74,107,0.12); color: var(--status-progress); }
.badge-review     { background: rgba(91,45,139,0.12); color: var(--status-review); }
.badge-blocked    { background: var(--clr-danger-bg); color: var(--clr-danger); }
.badge-done       { background: var(--clr-success-bg); color: var(--clr-success); }
.badge-cancelled  { background: rgba(156,123,107,0.12); color: var(--status-cancelled); }

/* Priority badges */
.badge-critical   { background: var(--clr-danger-bg); color: var(--clr-danger); }
.badge-high       { background: rgba(192,86,33,0.12); color: var(--priority-high); }
.badge-medium     { background: var(--clr-warning-bg); color: var(--clr-warning); }
.badge-low        { background: var(--clr-success-bg); color: var(--clr-success); }

/* Generic */
.badge-success    { background: var(--clr-success-bg); color: var(--clr-success); }
.badge-warning    { background: var(--clr-warning-bg); color: var(--clr-warning); }
.badge-danger     { background: var(--clr-danger-bg); color: var(--clr-danger); }
.badge-info       { background: var(--clr-info-bg); color: var(--clr-info); }
.badge-neutral    { background: var(--bg-page); color: var(--txt-muted); border: 1px solid var(--bdr-light); }
.badge-brand      { background: rgba(75,46,43,0.12); color: var(--clr-primary); }

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-success  { background: var(--clr-success); }
.dot-warning  { background: var(--clr-warning); }
.dot-danger   { background: var(--clr-danger); }
.dot-info     { background: var(--clr-info); }
.dot-muted    { background: var(--bdr-medium); }
.dot-primary  { background: var(--clr-primary); }
.dot-accent   { background: var(--clr-accent); }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--bg-page);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--bdr-light);
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--clr-accent);
  transition: width var(--t-slow);
}

.progress-fill.good    { background: var(--clr-success); }
.progress-fill.warning { background: var(--clr-warning); }
.progress-fill.danger  { background: var(--clr-danger); }

.progress-labeled {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.progress-labeled .progress-bar { flex: 1; }
.progress-labeled .progress-pct {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--txt-secondary);
  width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Avatars ──────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  background: var(--clr-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-xs);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm  { width: 24px; height: 24px; font-size: 10px; }
.avatar-md  { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar-lg  { width: 40px; height: 40px; font-size: var(--fs-sm); }
.avatar-xl  { width: 56px; height: 56px; font-size: var(--fs-md); }
.avatar-2xl { width: 80px; height: 80px; font-size: var(--fs-xl); }

.avatar-stack {
  display: flex;
  align-items: center;
}
.avatar-stack .avatar {
  margin-left: -6px;
  border: 2px solid var(--bg-card);
}
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
  color: var(--txt-muted);
  gap: var(--sp-4);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--txt-secondary);
}

.empty-state-body {
  font-size: var(--fs-sm);
  max-width: 360px;
  line-height: 1.6;
}

/* ── Loading Skeleton ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-page) 25%, var(--bdr-light) 50%, var(--bg-page) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--rad-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: var(--sp-2);
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.long { width: 90%; }
.skeleton-block { height: 80px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: var(--sp-4);
  border-radius: var(--rad-md);
  border: 1px solid;
  font-size: var(--fs-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.alert-icon { flex-shrink: 0; margin-top: 1px; }

.alert-success  { background: var(--clr-success-bg); border-color: var(--clr-success-bdr); color: var(--clr-success); }
.alert-warning  { background: var(--clr-warning-bg); border-color: var(--clr-warning-bdr); color: var(--clr-warning); }
.alert-danger   { background: var(--clr-danger-bg);  border-color: var(--clr-danger-bdr);  color: var(--clr-danger); }
.alert-info     { background: var(--clr-info-bg);    border-color: var(--clr-info-bdr);    color: var(--clr-info); }

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  max-width: 360px;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  animation: toast-in var(--t-normal) ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.toast-success { border-left: 3px solid var(--clr-success); }
.toast.toast-error   { border-left: 3px solid var(--clr-danger); }
.toast.toast-warning { border-left: 3px solid var(--clr-warning); }
.toast.toast-info    { border-left: 3px solid var(--clr-info); }

/* ── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: modal-overlay-in var(--t-normal) ease;
}

@keyframes modal-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--rad-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: auto;
  animation: modal-in var(--t-normal) ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal.modal-lg  { max-width: 760px; }
.modal.modal-xl  { max-width: 960px; }
.modal.modal-sm  { max-width: 400px; }

.modal-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--txt-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--txt-muted);
  padding: var(--sp-1);
  border-radius: var(--rad-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close:hover { background: var(--bg-hover); color: var(--txt-primary); }

.modal-body   { padding: var(--sp-6); }
.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}

/* ── Drawer (right-side panel) ────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.35);
  z-index: 200;
  animation: modal-overlay-in var(--t-normal) ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: drawer-in var(--t-slow) ease;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer.drawer-lg { width: 680px; }
.drawer.drawer-xl { width: 860px; }

.drawer-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.drawer-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--txt-primary);
  flex: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6);
}

.drawer-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-lg);
  box-shadow: var(--shadow-md);
  z-index: 150;
  overflow: hidden;
  animation: dropdown-in 140ms ease;
}

.dropdown-menu.align-right { left: auto; right: 0; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--txt-primary);
  cursor: pointer;
  transition: background var(--t-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.dropdown-item.danger { color: var(--clr-danger); }
.dropdown-item.danger:hover { background: var(--clr-danger-bg); }

.dropdown-divider {
  height: 1px;
  background: var(--bdr-light);
  margin: var(--sp-1) 0;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-md);
  font-size: var(--fs-sm);
  color: var(--txt-secondary);
  background: var(--bg-card);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  text-decoration: none !important;
  font-variant-numeric: tabular-nums;
}

.page-btn:hover { background: var(--bg-hover); border-color: var(--bdr-medium); }
.page-btn--active { background: var(--clr-primary); border-color: var(--clr-primary); color: #fff; }
.page-btn--disabled { opacity: 0.4; cursor: not-allowed; }

.page-ellipsis {
  color: var(--txt-muted);
  font-size: var(--fs-sm);
  padding: 0 var(--sp-2);
}

.page-info {
  margin-left: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--txt-muted);
}

/* ── Activity Feed ────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--bdr-light);
  position: relative;
}

.activity-item:last-child { border-bottom: none; }

.activity-avatar {
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: var(--fs-sm);
  color: var(--txt-primary);
  line-height: 1.4;
}

.activity-text strong { font-weight: 600; }

.activity-time {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
  margin-top: 2px;
}

/* ── Sections / Panels ────────────────────────────────────── */
.section {
  margin-bottom: var(--sp-6);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.section-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--txt-primary);
}

/* ── Stat row in KPI profile ─────────────────────────────── */
.stat-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--bdr-light);
  font-size: var(--fs-sm);
}
.stat-item:last-child { border-bottom: none; }
.stat-item-label { color: var(--txt-muted); }
.stat-item-value { font-weight: 600; color: var(--txt-primary); }

/* ── Employee Profile ─────────────────────────────────────── */
.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-6);
  padding: var(--sp-6);
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  margin-bottom: var(--sp-5);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 500;
  color: var(--clr-primary);
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}

.profile-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--txt-secondary);
  margin-bottom: var(--sp-3);
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ── Charts ───────────────────────────────────────────────── */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  overflow: hidden;
}

.chart-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.chart-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--txt-muted);
}

.chart-body {
  padding: var(--sp-5);
}

.chart-container {
  position: relative;
  height: 260px;
}

/* ── Dashboard grid ───────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  gap: var(--sp-5);
}

.dashboard-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.dashboard-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.dashboard-grid-mixed {
  grid-template-columns: 2fr 1fr;
}

/* ── Utility classes ──────────────────────────────────────── */
.d-flex { display: flex; }
.d-grid  { display: grid; }
.d-none  { display: none; }
.flex-1  { flex: 1; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.text-muted    { color: var(--txt-muted); }
.text-sm       { font-size: var(--fs-sm); }
.text-xs       { font-size: var(--fs-xs); }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.truncate      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full        { width: 100%; }
.min-w-0       { min-width: 0; }
.overflow-hidden { overflow: hidden; }

/* ── Login page specific ──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-xl);
  box-shadow: var(--shadow-md);
  padding: var(--sp-10) var(--sp-10);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
}

.login-logo img { width: 56px; height: auto; }

.login-logo-text {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  color: var(--clr-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-tagline {
  font-size: var(--fs-sm);
  color: var(--txt-muted);
  margin-top: var(--sp-1);
  text-align: center;
}

.login-form-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--txt-primary);
  margin-bottom: var(--sp-5);
}

/* ── Permission Denied ────────────────────────────────────── */
.permission-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--sp-4);
  text-align: center;
  padding: var(--sp-10);
}

.permission-denied-code {
  font-size: 64px;
  font-weight: 700;
  color: var(--bdr-medium);
  font-family: var(--font-display);
  line-height: 1;
}

.permission-denied-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--txt-secondary);
}

.permission-denied-body {
  font-size: var(--fs-sm);
  color: var(--txt-muted);
  max-width: 380px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-w-collapsed);
  }
  .sidebar-logo-text,
  .sidebar-section-label,
  .sidebar-link span,
  .sidebar-user-info,
  .nav-badge {
    display: none;
  }
  .sidebar-link {
    justify-content: center;
    padding: 10px;
  }
  .sidebar-logo { justify-content: center; padding: 16px 10px; }
  .sidebar-user { justify-content: center; padding: 12px; }
  .dashboard-grid-2,
  .dashboard-grid-3,
  .dashboard-grid-mixed {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0;
  }
  .sidebar {
    position: fixed;
    width: var(--sidebar-w-collapsed);
    transform: translateX(-100%);
    transition: transform var(--t-slow);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    width: 240px;
  }
  .sidebar.mobile-open .sidebar-logo-text,
  .sidebar.mobile-open .sidebar-section-label,
  .sidebar.mobile-open .sidebar-link span,
  .sidebar.mobile-open .sidebar-user-info,
  .sidebar.mobile-open .nav-badge {
    display: block;
  }
  .sidebar.mobile-open .sidebar-link {
    justify-content: flex-start;
    padding: 9px var(--sp-5);
  }
  .page-content { padding: var(--sp-4); }
  .form-row.cols-2,
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .header-search { display: none; }
  .drawer { width: 100%; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sidebar, .app-header, .header-actions, .filters-bar, .pagination, .btn { display: none !important; }
  .app-main { display: block; }
  body { background: white; color: black; }
  .card, .table-wrapper { border: 1px solid #ccc; break-inside: avoid; }
}

/* ── Global Search Dropdown ───────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 380px;
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow-y: auto;
  animation: dropdown-in 140ms ease;
}

.search-dropdown-group {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--bdr-light);
}
.search-dropdown-group:last-child { border-bottom: none; }

.search-dropdown-label {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt-muted);
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast);
}
.search-result-item:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.search-result-title {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--txt-primary);
  line-height: 1.3;
}
.search-result-sub {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
  margin-top: 1px;
}

.search-no-results {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--txt-muted);
  font-size: var(--fs-sm);
}

/* ── Notification Panel ───────────────────────────────────── */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 540px;
  background: var(--bg-card);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-lg);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dropdown-in 140ms ease;
}

.notif-panel-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--bdr-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.notif-panel-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--txt-primary);
}

.notif-panel-body {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--bdr-light);
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(192,133,82,0.05); }
.notif-item.unread:hover { background: rgba(192,133,82,0.10); }

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-accent);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item:not(.unread) .notif-dot { opacity: 0; }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--txt-primary);
  margin-bottom: 2px;
}
.notif-body {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-time {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
  margin-top: 2px;
}

.notif-panel-empty {
  padding: var(--sp-10);
  text-align: center;
  color: var(--txt-muted);
  font-size: var(--fs-sm);
}

/* ── Punch Widget (header) ────────────────────────────────── */
.punch-widget {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 5px var(--sp-4);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-md);
  background: var(--bg-page);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--txt-secondary);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  user-select: none;
}
.punch-widget:hover {
  background: var(--bg-hover);
  border-color: var(--bdr-medium);
}
.punch-widget.active {
  border-color: var(--clr-success);
  color: var(--clr-success);
  background: var(--clr-success-bg);
}

.punch-timer {
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}

/* ── Confirm Dialog ───────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,24,16,0.50);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: modal-overlay-in var(--t-normal) ease;
}

.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--rad-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-8);
  max-width: 400px;
  width: 100%;
  animation: modal-in var(--t-normal) ease;
  text-align: center;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon.danger { background: var(--clr-danger-bg); color: var(--clr-danger); }
.confirm-icon.warning { background: var(--clr-warning-bg); color: var(--clr-warning); }
.confirm-icon.info { background: var(--clr-info-bg); color: var(--clr-info); }

.confirm-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--txt-primary);
  margin-bottom: var(--sp-2);
}

.confirm-body {
  font-size: var(--fs-sm);
  color: var(--txt-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-6);
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
}

/* ── Mention autocomplete ─────────────────────────────────── */
.mention-dropdown {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-lg);
  box-shadow: var(--shadow-md);
  z-index: 400;
  min-width: 220px;
  max-height: 240px;
  overflow-y: auto;
  animation: dropdown-in 120ms ease;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--t-fast);
  font-size: var(--fs-sm);
  color: var(--txt-primary);
}
.mention-item:hover,
.mention-item.selected { background: var(--bg-hover); }

/* ── Empty state row in tables ────────────────────────────── */
td.empty-state-row {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--txt-muted);
  font-size: var(--fs-sm);
}

/* ── w-full on buttons ────────────────────────────────────── */
.btn.w-full {
  width: 100%;
  justify-content: center;
}

/* ── Nav badge standalone (non-sidebar) ───────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  background: var(--clr-accent);
  color: #fff;
  line-height: 1;
}
.nav-badge.danger { background: var(--clr-danger); }

/* ── Search dropdown wrapper positioning ──────────────────── */
.header-search-wrapper {
  position: relative;
}

/* ── Notification bell wrapper positioning ────────────────── */
.notif-wrapper {
  position: relative;
}

/* ── Header unread dot ────────────────────────────────────── */
.header-unread-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  background: var(--clr-accent);
  border-radius: 50%;
  border: 1.5px solid #fff;
  display: none;
}
.header-unread-dot.visible { display: block; }

/* ── Kanban Board ─────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-4);
  align-items: flex-start;
  scrollbar-width: thin;
  scrollbar-color: var(--bdr-medium) transparent;
}

.kanban-col {
  min-width: 280px;
  max-width: 280px;
  background: var(--bg-page);
  border-radius: var(--rad-lg);
  border: 1px solid var(--bdr-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.kanban-col-header {
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bdr-light);
  background: var(--bg-card);
  position: sticky;
  top: 0;
}

.kanban-col-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.kanban-col-count {
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--bdr-light);
  color: var(--txt-muted);
  padding: 1px 7px;
  border-radius: 10px;
}

.kanban-cards {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 80px;
  flex: 1;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-md);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.kanban-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--bdr-medium);
}
.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card-title {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--txt-primary);
  line-height: 1.3;
  margin-bottom: var(--sp-2);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ── Gantt / Timeline placeholder ─────────────────────────── */
.gantt-placeholder {
  background: var(--bg-card);
  border: 1px solid var(--bdr-light);
  border-radius: var(--rad-lg);
  padding: var(--sp-16);
  text-align: center;
  color: var(--txt-muted);
  font-size: var(--fs-sm);
}

/* ── Rich text editor area ────────────────────────────────── */
.rich-editor {
  border: 1px solid var(--bdr-medium);
  border-radius: var(--rad-md);
  overflow: hidden;
  background: var(--bg-input);
}
.rich-editor-toolbar {
  display: flex;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--bdr-light);
  background: var(--bg-page);
  flex-wrap: wrap;
}
.rich-editor-toolbar button {
  padding: 4px 8px;
  background: none;
  border: none;
  border-radius: var(--rad-sm);
  cursor: pointer;
  color: var(--txt-secondary);
  font-size: var(--fs-sm);
  transition: background var(--t-fast);
}
.rich-editor-toolbar button:hover { background: var(--bdr-light); }
.rich-editor-toolbar button.active { background: var(--bg-selected); color: var(--clr-primary); }
.rich-editor-body {
  padding: var(--sp-4);
  min-height: 120px;
  outline: none;
  font-size: var(--fs-sm);
  color: var(--txt-primary);
  line-height: 1.6;
}
.rich-editor-body:focus {
  box-shadow: inset 0 0 0 2px rgba(192,133,82,0.20);
}

/* ── Timeline / Milestones ────────────────────────────────── */
.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.milestone-item {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--bdr-light);
  align-items: flex-start;
}
.milestone-item:last-child { border-bottom: none; }

.milestone-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--clr-accent);
  margin-top: 3px;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--clr-accent);
}
.milestone-dot.completed { background: var(--clr-success); box-shadow: 0 0 0 2px var(--clr-success); }
.milestone-dot.overdue   { background: var(--clr-danger);  box-shadow: 0 0 0 2px var(--clr-danger); }

.milestone-content { flex: 1; min-width: 0; }
.milestone-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--txt-primary);
  margin-bottom: 2px;
}
.milestone-date {
  font-size: var(--fs-xs);
  color: var(--txt-muted);
}

/* ── Floating Action Button ───────────────────────────────── */
.fab {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  z-index: 99;
}
.fab:hover {
  background: var(--clr-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(75,46,43,0.25);
}

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,248,240,0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bdr-light);
  border-top-color: var(--clr-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Code blocks (audit log, etc.) ───────────────────────── */
code {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--fs-xs);
  background: var(--bg-page);
  padding: 2px 6px;
  border-radius: var(--rad-sm);
  color: var(--txt-secondary);
  border: 1px solid var(--bdr-light);
}

/* ── Focus-visible ring (accessibility) ───────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}
