:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --line: rgba(15, 23, 42, 0.08);
  /* Theming */
  --heading-color: #1d4ed8; /* Dashboard header/title color */
  --table-head-bg: #eef2ff; /* Dashboard table header background */
  --table-head-fg: #0f172a; /* Dashboard table header text */
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); -webkit-user-select: none; user-select: none; }
body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; }
input, textarea, [contenteditable="true"], .selectable { -webkit-user-select: text; user-select: text; }
.table th, .table td { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; }

/* Hide page scrollbar (scroll still works via mouse/trackpad) */
html, body { -ms-overflow-style: none; scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; }

.topbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,0.03); z-index: 30; }
.topbar__inner { width: 100%; height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.topbar__left { display: inline-flex; align-items: center; }
.brand { font-weight: 600; font-size: 16px; letter-spacing: 0.2px; }
.brand small { color: var(--muted); font-weight: 500; margin-left: 8px; }
.brand-home { display: inline-flex; align-items: center; margin-right: 10px; }
.brand-home:focus-visible { outline: 2px solid #7aa7ff; outline-offset: 2px; border-radius: 8px; }
.brand-home__logo { display: block; border-radius: 8px; }
.nav-toggle { display: none; appearance: none; border: 0; background: transparent; padding: 8px; margin-right: 8px; border-radius: 8px; }
.nav-toggle:focus-visible { outline: 2px solid #7aa7ff; outline-offset: 2px; }
.nav-toggle .bar { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px 0; border-radius: 1px; }
/* Search in topbar */
.topbar__center { flex: 1; max-width: 520px; margin: 0 16px; }
.search__input { width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.search__input:focus { outline: 2px solid #7aa7ff; outline-offset: 1px; }
.search { position: relative; }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #64748b; display: inline-flex; align-items: center; }
.search__dropdown { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 50; max-height: 300px; overflow: auto; }
.search__group { padding: 6px 8px; border-bottom: 1px solid var(--line); background: rgba(15, 23, 42, 0.02); font-size: 12px; color: #334155; font-weight: 600; }
.search__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.search__item:hover, .search__item[aria-selected="true"] { background: rgba(15, 23, 42, 0.05); }
.search__badge { font-size: 11px; color: #475569; background: rgba(15,23,42,0.06); padding: 2px 6px; border-radius: 999px; margin-left: auto; }

/* Notifications */
.notif { position: relative; }
.notif__button { position: relative; }
.notif__badge { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.notif__badge[hidden] { display: none !important; }
.notif__dropdown { position: absolute; top: 44px; right: 0; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 60; max-height: 360px; overflow: auto; }
.notif__group { padding: 6px 10px; border-bottom: 1px solid var(--line); background: rgba(15, 23, 42, 0.02); font-size: 12px; color: #334155; font-weight: 600; }
.notif__item { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; padding: 8px 10px; align-items: center; cursor: pointer; }
.notif__item:hover { background: rgba(15,23,42,0.05); }
.notif__item.unread { font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 999px; }
.dot.holiday { background: #16a34a; }
.dot.event { background: #1d4ed8; }
.dot.reminder { background: #f59e0b; }
.dot.leave { background: #0ea5e9; }
.notif__empty { padding: 12px; color: #64748b; }

.topbar__right { display: inline-flex; align-items: center; gap: 10px; }

.team-header { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.team-header .team-avatar { width: 20px; height: 20px; }
.team-header .team-name { font-size: 13px; color: #334155; }

.layout { display: flex; width: 100%; }
.layout__inner { display: flex; width: 100%; min-height: calc(100vh - 56px); }

.sidebar { width: 260px; border-right: 1px solid var(--line); background: #fff; position: sticky; top: 56px; height: calc(100vh - 56px); padding: 16px; overflow: auto; flex-shrink: 0; display: flex; flex-direction: column; }
nav.menu .menu-row { display: flex; align-items: center; gap: 8px; }
nav.menu .menu-row a { flex: 1; }
nav.menu .menu-row .btn.icon { width: 34px; height: 34px; justify-content: center; }
.user { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(120% 120% at 20% 10%, #bfdcff, #7aa7ff); color: #fff; display: grid; place-items: center; font-weight: 600; letter-spacing: 0.3px; }
.username { font-weight: 600; }
.user-role { color: var(--muted); font-size: 12px; margin-top: 2px; }

nav.menu { margin-top: 8px; display: grid; gap: 4px; flex: 1 1 auto; align-content: start; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: inherit; text-decoration: none; }
.menu a:hover { background: rgba(15, 23, 42, 0.04); }
.menu a:focus-visible { outline: 2px solid #7aa7ff; outline-offset: 2px; }
.menu a.active { background: rgba(15, 23, 42, 0.06); font-weight: 600; }
/* Column resize handles for Name/Comment */
.table th { position: relative; }
.table th .col-resizer { position: absolute; right: 0; top: 0; width: 6px; height: 100%; cursor: col-resize; user-select: none; }
.table th .col-resizer:hover { background: rgba(0,0,0,0.08); }
.menu .icon { width: 18px; height: 18px; opacity: 0.8; }

/* Teams panel */
.teams { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.teams__header { font-size: 12px; color: #64748b; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.teams__select { position: relative; }
.teams__dropdown { position: absolute; left: 0; right: 0; bottom: 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 70; max-height: 240px; overflow: auto; padding: 6px 0; }
.team-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; }
.team-item:hover, .team-item[aria-selected="true"] { background: rgba(15, 23, 42, 0.05); }
.team-dot { width: 8px; height: 8px; border-radius: 999px; background: #7aa7ff; opacity: 0.8; }
.team-manage { padding: 8px 10px; color: #1d4ed8; cursor: pointer; border-top: 1px solid var(--line); }
.team-manage:hover { background: rgba(29,78,216,0.08); }
/* Team avatars */
.team-avatar { width: 18px; height: 18px; border-radius: 999px; object-fit: cover; display: inline-block; }
.team-avatar.fallback { display: inline-grid; place-items: center; color: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }

/* Simple Gantt (per project) */
.gantt { margin-top: 8px; }
.gantt__title { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.gantt__toolbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; }
.gantt__bars { height: 160px; display: flex; align-items: flex-end; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; background-image: repeating-linear-gradient(to top, rgba(15,23,42,0.06) 0, rgba(15,23,42,0.06) 1px, transparent 1px, transparent 20px); }
.gantt__col { flex: 1 1 0; min-width: 3px; display: flex; align-items: flex-end; height: 100%; position: relative; }
.gantt__bar { width: 100%; background: #22c55e; /* green-500 */ border-radius: 3px 3px 0 0; }
.gantt__col.is-selected .gantt__bar { box-shadow: inset 0 0 0 2px #2563eb; }
.gantt__fab { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); padding: 6px 10px; z-index: 100; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.gantt__fab:hover { background: rgba(15,23,42,0.04); }
.gantt__axis { display: flex; gap: 2px; margin-top: 4px; }
.gantt__label { flex: 1 1 0; text-align: center; font-size: 9px; color: #64748b; }
.gantt__tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(4px); opacity: 0; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); padding: 6px 8px; z-index: 40; white-space: nowrap; }
.gantt__tip::after { content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); border-width: 0 6px 6px 6px; border-style: solid; border-color: transparent transparent #fff transparent; }
.gantt__col:hover .gantt__tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.gantt__tip .tip-count { font-weight: 700; margin-right: 8px; font-size: 13px; }
.gantt__tip .tip-avatars { display: inline-flex; gap: 6px; vertical-align: middle; }

main.content { flex: 1; padding: 24px 16px; width: 100%; }

/* Auto-minimize sidebar (desktop) */
@media (min-width: 769px) {
  body.sidebar-auto-min .layout__inner { padding-left: 64px; padding-right: 0; }
  body.sidebar-auto-min .sidebar {
    position: fixed;
    left: 0;
    right: auto;
    top: 56px;
    height: calc(100vh - 56px);
    width: 64px;
    padding: 12px 8px;
    overflow: hidden;
    z-index: 20;
    transition: width 180ms ease, padding 180ms ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-left: none;
    border-right: 1px solid var(--line);
  }
  body.sidebar-auto-min .sidebar:hover {
    width: 260px;
    padding: 16px;
    overflow: auto;
  }
  body.sidebar-auto-min nav.menu { gap: 6px; }
  body.sidebar-auto-min .menu a { justify-content: center; padding: 10px; }
  body.sidebar-auto-min .menu a span { display: none; }
  body.sidebar-auto-min #dashboardsMenu { display: none; }
  body.sidebar-auto-min #teamsPanel { display: none; }
  body.sidebar-auto-min nav.menu .menu-row { flex-direction: column; gap: 6px; }
  body.sidebar-auto-min nav.menu .menu-row a { flex: 0 0 auto; width: 100%; justify-content: center; }
  body.sidebar-auto-min .sidebar:hover .menu a { justify-content: flex-start; padding: 10px 12px; }
  body.sidebar-auto-min .sidebar:hover .menu a span { display: inline; }
  body.sidebar-auto-min .sidebar:hover #dashboardsMenu { display: block; }
  body.sidebar-auto-min .sidebar:hover #teamsPanel { display: block; }
  body.sidebar-auto-min .sidebar:hover nav.menu .menu-row { flex-direction: row; gap: 8px; }
  body.sidebar-auto-min .sidebar:hover nav.menu .menu-row a { flex: 1 1 auto; width: auto; justify-content: flex-start; }
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { background: rgba(15, 23, 42, 0.03); }
.btn:focus-visible { outline: 2px solid #7aa7ff; outline-offset: 2px; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn.danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; border-color: #dc2626; }
.btn.icon { padding: 0 8px; width: 36px; justify-content: center; }
.toolbar .btn { white-space: nowrap; }
.dashboard-view .panel { border: none; box-shadow: none; background: transparent; }
.dashboard-view .panel__header { border-bottom: none; background: transparent; padding-left: 0; padding-right: 0; color: var(--heading-color); }
.dashboard-view .panel__body { padding-left: 0; padding-right: 0; }
.dashboard-view .table { border: none; border-radius: 0; background: transparent; overflow: visible; }
.dashboard-view .btn { border-color: transparent; }
.dashboard-view .table tbody td { border-bottom: none !important; }
.dashboard-view .empty { border: none; }
.db-select{
  border:1px solid var(--line);
  border-radius:999px;
  padding:0 32px 0 12px;
  background:#fff;
  font-weight:600;
  min-width:180px;
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.db-select:focus{ outline:2px solid #7aa7ff; outline-offset:2px; }
.toggle-pill{display:inline-flex;align-items:center;gap:8px;cursor:pointer;user-select:none}
.toggle-pill input{position:absolute;opacity:0;width:0;height:0;pointer-events:none}
.toggle-track{position:relative;width:36px;height:20px;border-radius:999px;background:#cbd5e1;display:inline-flex;align-items:center;transition:background .2s ease}
.toggle-thumb{width:16px;height:16px;border-radius:50%;background:#fff;transform:translateX(2px);transition:transform .2s ease;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.toggle-pill input:checked + .toggle-track{background:#22c55e}
.toggle-pill input:checked + .toggle-track .toggle-thumb{transform:translateX(18px)}

/* Remove input/select rectangles in Dashboard table */
.dashboard-view input.in,
.dashboard-view select.in,
.dashboard-view textarea.in {
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100%;
  padding: 6px 0;
}
.dashboard-view input.in:focus,
.dashboard-view select.in:focus,
.dashboard-view textarea.in:focus {
  outline: none !important;
  box-shadow: none !important;
  border-bottom: 2px solid #2563eb; /* underline focus, not a rectangle */
}

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar h1 { font-size: 18px; margin: 0; color: var(--heading-color); }

/* Modern table styling for Dashboard */
.dashboard-view .table-wrap { overflow-x: auto; overflow-y: hidden; width: 100%; }
.dashboard-view .table { border: none; border-radius: 12px; background: #fff; width: max-content; min-width: 760px; table-layout: auto; }
.dashboard-view thead th { position: sticky; top: 0; z-index: 1; background: var(--table-head-bg); color: var(--table-head-fg); font-weight: 700; font-size: 13px; letter-spacing: .2px; }
.dashboard-view tbody tr:nth-child(odd) { background: rgba(15,23,42,0.02); }
.dashboard-view tbody tr:hover { background: rgba(37,99,235,0.06); }
.dashboard-view tbody td { padding-top: 10px; padding-bottom: 10px; }
.dashboard-view .table thead th, .dashboard-view .table tbody td { border-bottom: 1px solid var(--line); }
.dashboard-view .table tbody tr:last-child td { border-bottom: none; }
.dashboard-view .table thead th:first-child, .dashboard-view .table tbody td:first-child { padding-left: 4px; width: 56px; }
.dashboard-view input.in, .dashboard-view select.in, .dashboard-view textarea.in { padding-left: 0; padding-right: 0; }
.dashboard-view select.in { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 24px; }
.dashboard-view .table [data-col-id="name"] { min-width: 180px; }
.dashboard-view .table [data-col-id="status"] { min-width: 120px; }
.dashboard-view .table [data-col-id="iterationNo"] { min-width: 140px; }
.dashboard-view .table [data-col-id="assignedTo"],
.dashboard-view .table [data-col-id="closedBy"] { min-width: 140px; }
.dashboard-view .table [data-col-id="receivedDate"],
.dashboard-view .table [data-col-id="completedDate"] { min-width: 140px; white-space: nowrap; }
.dashboard-view .table [data-col-id="iterationStatus"] { min-width: 140px; }
.dashboard-view .table [data-col-id="comment"] { min-width: 240px; white-space: normal; }
.dashboard-view .table [data-col-type="number"] { min-width: 120px !important; max-width: 160px; }
.dashboard-view input.in[type="number"] { text-align: center; }
.filter-popover { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); padding: 10px; min-width: 220px; z-index: 120; }
.filter-popover__header { font-weight: 700; margin-bottom: 6px; color: #1d4ed8; }
.filter-popover__body { margin-bottom: 8px; }
.filter-popover input.filter-input, .filter-popover select.filter-input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; }
.filter-popover__footer { display: flex; gap: 8px; justify-content: flex-end; }
.filter-popover.column-menu { min-width: 260px; }
.filter-popover.edit-col { min-width: 260px; width: 280px; }
.col-menu-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid transparent; border-radius: 10px; }
.col-menu-item:hover { background: rgba(15,23,42,0.03); }
.col-drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: var(--muted); cursor: grab; border-radius: 8px; }
.col-menu-item.is-fixed .col-drag-handle { opacity: 0.4; cursor: not-allowed; }
.col-menu-item.is-drag-over { background: rgba(37,99,235,0.06); border-color: rgba(37,99,235,0.25); }
.col-menu-item.drop-before { box-shadow: inset 0 3px 0 #2563eb; }
.col-menu-item.drop-after { box-shadow: inset 0 -3px 0 #2563eb; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 200; }
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 201; }
.modal__panel { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.2); }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal__title { margin: 0; font-size: 16px; font-weight: 600; }
.modal__body { padding: 16px; display: grid; gap: 12px; }
.modal__footer { padding: 12px 16px 14px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.tab-buttons { display: inline-flex; gap: 8px; background: rgba(15,23,42,0.04); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.tab-btn { border: none; background: transparent; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tab-btn.active { background: #2563eb; color: #fff; }
/* Selected row highlight */


/* Table */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: rgba(15, 23, 42, 0.02); font-weight: 600; font-size: 13px; color: #334155; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr.is-selected { background: rgba(37, 99, 235, 0.08); outline: 2px solid rgba(37, 99, 235, 0.25); outline-offset: -2px; }
.cell-actions { display: inline-flex; gap: 8px; }
.avatar.small { width: 28px; height: 28px; font-size: 12px; }
.name-cell { display: flex; align-items: center; gap: 10px; }

/* Empty state */
.empty { border: 1px dashed var(--line); border-radius: 10px; padding: 24px; text-align: center; color: var(--muted); }

/* Dialog (modal) */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: none; z-index: 20; }
.dialog { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 21; }
.dialog.open, .dialog-backdrop.open { display: flex; }
.dialog__panel { width: 100%; max-width: 560px; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); border: 1px solid var(--line); }
.dialog__header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dialog__title { font-size: 16px; font-weight: 600; margin: 0; }
.dialog__body { padding: 16px; display: grid; gap: 12px; }
.dialog__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); }

/* Form */
.field { display: grid; gap: 6px; width: 100%; }
.field label { font-size: 13px; color: #334155; }
.input, .select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.textarea { min-height: 72px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid #7aa7ff; outline-offset: 1px; }
.modal__panel .input, .modal__panel .select, .modal__panel .textarea { max-width: 100%; }
.modal__panel .input:focus, .modal__panel .select:focus, .modal__panel .textarea:focus { outline-offset: 0; }
.hint { font-size: 12px; color: var(--muted); }
.required { color: #ef4444; margin-left: 2px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* Chips */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.06); font-size: 12px; color: #334155; }

/* Image preview & actions */
.img-row { display: flex; align-items: center; gap: 12px; }
.img-actions { display: inline-flex; gap: 8px; }
.avatar.preview { width: 56px; height: 56px; font-size: 18px; }
img.preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; }

/* Panels for Export/Import */
.stack { display: grid; gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.panel__header { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.panel__body { padding: 14px; display: grid; gap: 12px; }
.panel .row { align-items: center; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; color: #334155; }

/* Calendar */
.cal { display: grid; gap: 12px; }
.cal__toolbar { display: flex; align-items: center; justify-content: space-between; }
.cal__month { font-size: 18px; font-weight: 600; }
.cal__nav { display: inline-flex; gap: 8px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.cal__dayname, .cal__cell { padding: 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 90px; }
.cal__dayname { background: rgba(15, 23, 42, 0.02); font-weight: 600; font-size: 12px; color: #334155; min-height: auto; }
.cal__cell:nth-child(7n), .cal__dayname:nth-child(7n) { border-right: none; }
.cal__row:last-child .cal__cell { border-bottom: none; }
.cal__cell { position: relative; cursor: pointer; }
.cal__date { position: absolute; top: 8px; right: 8px; font-size: 12px; color: #334155; }
.cal__events { margin-top: 28px; display: grid; gap: 6px; }
.event { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.event.type-holiday { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.event.type-event { background: #dbeafe; color: #1e3a8a; border-color: #bfdbfe; }
.event.type-reminder { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.event.type-leave { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.event .remove { all: unset; cursor: pointer; color: inherit; opacity: 0.8; }
.muted-date { color: #94a3b8; }
/* Weekoffs (weekends) */
.weekoff { background: #f1f5f9; }
.weekoff .cal__date { color: #64748b; }
.cal__cell.today { background: #ffe4e6; }
.cal__cell.today .cal__date { background: transparent; color: inherit; padding: 0; }
.event .meta { color: #475569; font-size: 11px; opacity: 0.9; }
.cal__cell.highlight { outline: 2px solid #2563eb; outline-offset: -2px; }

@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }
  .topbar__center { max-width: none; }
  .sidebar { position: fixed; left: 0; top: 56px; height: calc(100vh - 56px); transform: translateX(-100%); transition: transform 200ms ease; box-shadow: 0 10px 30px rgba(0,0,0,0.12); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .backdrop { display: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,0.25); }
}
