/* ==========================================================================
   DigiMali Staff Intranet — Shared Stylesheet
   Static demo. Design system: tokens, layout, components, utilities.
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. Design Tokens                                                            */
/* -------------------------------------------------------------------------- */
:root {
  /* Brand palette — DigiMali (pink primary, plum chrome) */
  --red: #ea3370;            /* primary accent (DigiMali pink) */
  --red-dark: #c41f5a;
  --red-soft: #fce9f1;
  --orange: #f3a93c;         /* warm secondary (harmonises with logo gold) */
  --orange-soft: #fdf1e0;

  /* Neutrals */
  --text: #222222;
  --text-secondary: #666666;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e1e4e8;
  --border-strong: #cfd4da;

  /* Status */
  --green: #1f8a4c;
  --green-soft: #e7f4ec;
  --amber: #d99100;
  --amber-soft: #fdf3e0;
  --blue: #2364aa;
  --blue-soft: #e8f0f8;
  --purple: #6b4ea0;
  --purple-soft: #efeaf7;

  /* DigiMali brand */
  --digimali: #2c1331;       /* deep plum (nav / sidebar) */
  --digimali-2: #3a1d42;
  --digimali-maroon: #5a1e3c;/* wine (cards / hero, matches site login card) */
  --digimali-teal: #5fcedb;
  --digimali-pink: #ea3370;
  --digimali-gold: #f3c461;

  /* Layout */
  --sidebar-w: 264px;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);

  /* Typography */
  --font: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

/* -------------------------------------------------------------------------- */
/* 2. Base                                                                     */
/* -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 12px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid rgba(35, 100, 170, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--red); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--digimali);
  color: #d6cfdb;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 60;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky; top: 0; background: var(--digimali); z-index: 1;
}
.sidebar__brand .brand-mark { flex-shrink: 0; }
.sidebar__brand .brand-logo { height: 30px; width: auto; }
.sidebar__brand .brand-text { line-height: 1.1; }
.sidebar__brand .brand-text strong { color: #fff; font-size: 15px; display: block; }
.sidebar__brand .brand-text span { font-size: 11px; color: #b3a4ba; }
.sidebar__brand .brand-divider { width: 1px; height: 26px; background: rgba(255,255,255,.18); }

.sidebar__nav { padding: 10px 12px 24px; flex: 1; }
.nav-group { margin-top: 16px; }
.nav-group__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: #9b8aa3; padding: 6px 12px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: #d6cfdb; font-size: 14px; font-weight: 500;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.09); color: #fff; text-decoration: none; }
.nav-item.is-active { background: var(--red); color: #fff; }
.nav-item.is-active .nav-item__icon { color: #fff; }
.nav-item__icon { width: 18px; height: 18px; flex-shrink: 0; color: #b3a4ba; }
.nav-item__badge {
  margin-left: auto; background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px;
}

/* "Developed by DigiMali" credit */
.sidebar__foot {
  margin-top: auto; padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--digimali);
}
.sidebar__foot .foot-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #9b8aa3; font-weight: 700; display: block; margin-bottom: 6px;
}
.sidebar__foot img { width: 132px; height: auto; opacity: 0.95; }

/* Main column */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Header */
.topbar {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}
.topbar__menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 8px; color: var(--text);
}
.topbar__menu-btn:hover { background: var(--bg); }
.topbar__title { font-size: 18px; font-weight: 700; white-space: nowrap; }

.search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px;
}
.search:focus-within { border-color: var(--blue); background: #fff; }
.search svg { color: var(--text-secondary); flex-shrink: 0; }
.search input {
  border: none; background: none; outline: none; width: 100%;
  font-size: 14px; color: var(--text);
}

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 50%; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--bg); }
.icon-btn__dot {
  position: absolute; top: 8px; right: 9px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
}
.user-chip:hover { background: var(--bg); border-color: var(--border); }
.user-chip__meta { line-height: 1.15; text-align: left; }
.user-chip__meta strong { font-size: 13px; display: block; }
.user-chip__meta span { font-size: 11px; color: var(--text-secondary); }

/* Avatars (CSS initials, no image files needed) */
.avatar {
  flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; background: var(--blue);
  width: 36px; height: 36px; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.02em;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar--xl { width: 92px; height: 92px; font-size: 30px; }
.avatar.c0 { background: #2364aa; } .avatar.c1 { background: #ea3370; }
.avatar.c2 { background: #1f8a4c; } .avatar.c3 { background: #6b4ea0; }
.avatar.c4 { background: #d99100; } .avatar.c5 { background: #0f7d8c; }
.avatar.c6 { background: #b5417a; } .avatar.c7 { background: #4a5568; }

/* Content area */
.content { padding: 24px; max-width: 1500px; width: 100%; }
.content--narrow { max-width: 1100px; }

/* Notification dropdown */
.dropdown { position: relative; }
.dropdown__panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 360px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 80; overflow: hidden;
  display: none;
}
.dropdown.is-open .dropdown__panel { display: block; }
.dropdown__head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.dropdown__head strong { font-size: 15px; }
.dropdown__list { max-height: 380px; overflow-y: auto; }
.dropdown__item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.dropdown__item:hover { background: var(--bg); }
.dropdown__item.is-unread { background: var(--blue-soft); }
.dropdown__item.is-unread:hover { background: #dde9f6; }
.dropdown__icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dropdown__foot { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }

/* Sidebar overlay for mobile */
.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  z-index: 55; display: none;
}
.scrim.is-open { display: block; }

/* -------------------------------------------------------------------------- */
/* 4. Page header / breadcrumbs                                                */
/* -------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 10px;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs .sep { color: var(--border-strong); }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head__title { font-size: 24px; }
.page-head__sub { color: var(--text-secondary); margin: 4px 0 0; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------------------------------------------------- */
/* 5. Buttons                                                                  */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn--accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn--accent:hover { filter: brightness(0.95); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--bg); color: var(--text); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--lg { padding: 12px 20px; font-size: 15px; }

/* -------------------------------------------------------------------------- */
/* 6. Cards & grids                                                            */
/* -------------------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.card__head h3 { font-size: 15px; }
.card__body { padding: 18px; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--border); }
.card--pad { padding: 18px; }
.card--hover { transition: box-shadow .15s, transform .15s; }
.card--hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--auto-lg { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.layout-2col { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.layout-sidebar-left { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }

.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); font-weight: 700; margin: 0 0 12px;
}
.stack > * + * { margin-top: 18px; }

/* -------------------------------------------------------------------------- */
/* 7. Stat cards                                                               */
/* -------------------------------------------------------------------------- */
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; align-items: flex-start; gap: 14px;
}
.stat__icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat__value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat__label { color: var(--text-secondary); font-size: 13px; margin-top: 6px; }
.stat__trend { font-size: 12px; font-weight: 600; margin-top: 8px; display: inline-flex; gap: 4px; }
.stat__trend.up { color: var(--green); }
.stat__trend.down { color: var(--red); }

/* -------------------------------------------------------------------------- */
/* 8. Badges, tags, status                                                     */
/* -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge--orange { background: var(--orange-soft); color: #b5610f; border-color: transparent; }
.badge--green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge--amber { background: var(--amber-soft); color: #9a6800; border-color: transparent; }
.badge--blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge--purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.badge--grey { background: #eef0f3; color: #50565f; border-color: transparent; }
.badge--solid-red { background: var(--red); color: #fff; border-color: transparent; }

.tag {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px;
}

.access-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.access-all { background: var(--green-soft); color: var(--green); }
.access-restricted { background: var(--red-soft); color: var(--red); }
.access-team { background: var(--blue-soft); color: var(--blue); }
.access-admin { background: var(--purple-soft); color: var(--purple); }

/* -------------------------------------------------------------------------- */
/* 9. Lists & rows                                                             */
/* -------------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg); }
.list-row__main { min-width: 0; flex: 1; }
.list-row__title { font-weight: 600; font-size: 14px; }
.list-row__meta { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }

.media { display: flex; gap: 12px; align-items: flex-start; }
.media__body { min-width: 0; flex: 1; }

.dot-sep::before { content: "•"; margin: 0 6px; color: var(--border-strong); }

/* -------------------------------------------------------------------------- */
/* 10. Tables                                                                  */
/* -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px;
}
table.data th, table.data td {
  text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data th {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary); background: var(--bg); font-weight: 700;
}
table.data tbody tr:hover { background: var(--bg); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------------- */
/* 11. Forms & toggles                                                         */
/* -------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); outline: none; }
.textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px;
}
.filter-bar .select { width: auto; min-width: 150px; }
.filter-bar .search { margin: 0; max-width: 280px; flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); }
.chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; background: #c5cad1;
  border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 3px solid rgba(35,100,170,.45); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row__text strong { display: block; font-size: 14px; }
.setting-row__text span { font-size: 12.5px; color: var(--text-secondary); }

/* -------------------------------------------------------------------------- */
/* 12. Tabs                                                                    */
/* -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text-secondary);
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--red); border-bottom-color: var(--red); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* -------------------------------------------------------------------------- */
/* 13. Modal                                                                   */
/* -------------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 120; display: none;
  align-items: center; justify-content: center; padding: 24px;
}
.modal.is-open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(16,24,40,.55); }
.modal__dialog {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* -------------------------------------------------------------------------- */
/* 14. Document & misc components                                              */
/* -------------------------------------------------------------------------- */
.doc-icon {
  width: 44px; height: 44px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .02em;
}
.doc-pdf { background: #c8102e; } .doc-doc { background: #2364aa; }
.doc-xls { background: #1f8a4c; } .doc-ppt { background: #d35400; }
.doc-zip { background: #6b4ea0; } .doc-img { background: #0f7d8c; }

.doc-preview {
  background: repeating-linear-gradient(0deg, #fafbfc, #fafbfc 28px, #f1f3f5 28px, #f1f3f5 29px);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 520px; padding: 40px; position: relative;
}
.doc-preview__page {
  background: #fff; box-shadow: var(--shadow); max-width: 560px; margin: 0 auto;
  padding: 48px 52px; min-height: 440px; border: 1px solid var(--border);
}
.doc-preview__bar { height: 12px; border-radius: 4px; background: #e9ebef; margin-bottom: 12px; }
.doc-preview__bar.short { width: 45%; } .doc-preview__bar.med { width: 75%; }
.doc-preview__bar.title { height: 20px; width: 60%; background: #d6dae0; margin-bottom: 22px; }

/* Empty state */
.empty {
  text-align: center; padding: 48px 24px; color: var(--text-secondary);
}
.empty__icon {
  width: 64px; height: 64px; border-radius: 16px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
  color: var(--border-strong);
}
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* Progress bar */
.progress { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress__fill { height: 100%; border-radius: 999px; background: var(--green); }

/* Mini chart helpers (CSS/SVG mock charts) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; }
.bars .bar { flex: 1; background: var(--blue); border-radius: 6px 6px 0 0; min-height: 4px; position: relative; }
.bars .bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-secondary); }
.bars .bar.alt { background: var(--orange); }

.donut {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--red) 0 55%, var(--orange) 55% 78%, var(--blue) 78% 92%, var(--border) 92% 100%);
}
.donut__hole { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut__hole strong { font-size: 22px; } .donut__hole span { font-size: 11px; color: var(--text-secondary); }

.legend { display: flex; flex-direction: column; gap: 8px; }
.legend span { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* health/status pill */
.health { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.health i { width: 9px; height: 9px; border-radius: 50%; }
.health i.ok { background: var(--green); } .health i.warn { background: var(--amber); } .health i.err { background: var(--red); }

/* Calendar */
.cal { width: 100%; border-collapse: collapse; }
.cal th { padding: 8px; font-size: 12px; text-transform: uppercase; color: var(--text-secondary); }
.cal td {
  border: 1px solid var(--border); vertical-align: top; height: 92px; width: 14.28%;
  padding: 6px; position: relative;
}
.cal td.muted { background: var(--bg); color: var(--border-strong); }
.cal td.today { background: var(--red-soft); }
.cal .daynum { font-size: 12px; font-weight: 700; }
.cal .ev {
  display: block; font-size: 11px; font-weight: 600; color: #fff;
  border-radius: 4px; padding: 2px 6px; margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ev-company { background: var(--red); } .ev-meeting { background: var(--blue); }
.ev-training { background: var(--green); } .ev-deadline { background: var(--orange); }
.ev-maint { background: #4a5568; } .ev-exec { background: var(--purple); }
.ev-wellness { background: #0f7d8c; }

/* Org chart */
.org { text-align: center; }
.org__node {
  display: inline-block; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; box-shadow: var(--shadow-sm);
}
.org__row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; position: relative; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
  background: linear-gradient(150deg, #2c1331 0%, #5a1e3c 60%, #ea3370 130%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; text-align: center;
}
.login-hero::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 360px; height: 360px; border-radius: 50%; background: rgba(95,206,219,.22);
}
.login-hero__brand {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  position: relative; z-index: 1;
}
.login-hero__logo { width: 132px; height: auto; border-radius: 22px; }
.login-hero__name { font-size: 44px; margin: 0; line-height: 1.05; letter-spacing: .5px; }
.login-hero__tag { font-size: 19px; margin: 0; opacity: .92; letter-spacing: 1px; text-transform: uppercase; }
.login-hero__footer { opacity: .8; font-size: 12.5px; margin: 0; position: relative; z-index: 1; }
.login-hero__list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.login-hero__list li { display: flex; gap: 12px; align-items: flex-start; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }

/* Website-style wine sign-in card */
.login-formcard {
  width: 100%; max-width: 420px;
  background: var(--digimali-maroon); color: #fff;
  border-radius: var(--radius-lg); padding: 34px 32px; box-shadow: var(--shadow-lg);
}
.login-formcard .field label { color: #f2e6ed; }
.login-formcard .hint, .login-formcard .text-secondary { color: #d9c6d2 !important; }
.login-formcard .divider-or { color: #d9c6d2; }
.login-formcard .divider-or::before, .login-formcard .divider-or::after { background: rgba(255,255,255,.22); }
.login-formcard .btn:not(.btn--primary) { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.28); color: #fff; }
.login-formcard .btn:not(.btn--primary):hover { background: rgba(255,255,255,.12); }
.login-formcard a { color: #ff9ec4; }
.login-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 10px;
  border: 3px solid var(--digimali-pink); background: rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: center; color: var(--digimali-teal);
}
.login-title { text-align: center; font-size: 22px; }
.login-rule { width: 40px; height: 3px; border-radius: 3px; background: var(--digimali-pink); margin: 8px auto 24px; }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw__eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: none; cursor: pointer;
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center; border-radius: 7px;
}
.pw__eye:hover { background: var(--bg); }
.divider-or { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 13px; margin: 18px 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.notice {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--blue-soft); color: #1c4f86; font-size: 13px; border: 1px solid #cfe0f1;
}

/* Welcome banner */
.welcome {
  background: linear-gradient(120deg, #2c1331, #5a1e3c 58%, #ea3370);
  color: #fff; border-radius: var(--radius-lg); padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.welcome::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(95,206,219,.2);
}
.welcome h2 { font-size: 22px; }
.welcome p { opacity: .9; margin: 6px 0 0; }
.welcome .badge { background: rgba(255,255,255,.18); color: #fff; }

/* Quick links */
.quicklink {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
.quicklink:hover { border-color: var(--red); text-decoration: none; box-shadow: var(--shadow); }
.quicklink__icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.quicklink strong { color: var(--text); font-size: 14px; }
.quicklink span { color: var(--text-secondary); font-size: 12.5px; }

/* Feed */
.feed-post { padding: 18px; }
.feed-post__head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.feed-post__img {
  border-radius: var(--radius-sm); height: 200px; margin: 14px 0;
  background: linear-gradient(135deg, var(--blue-soft), var(--orange-soft));
  display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 13px;
}
.feed-post__actions { display: flex; gap: 18px; color: var(--text-secondary); font-size: 13px; padding-top: 12px; border-top: 1px solid var(--border); }
.feed-post__actions span { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.feed-post__actions span:hover { color: var(--red); }

/* Helpers */
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }

/* -------------------------------------------------------------------------- */
/* 15. Responsive                                                              */
/* -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .layout-2col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar__menu-btn { display: inline-flex; }
  .search { display: none; }
  .layout-sidebar-left { grid-template-columns: 1fr; }
  .user-chip__meta { display: none; }
}

@media (max-width: 680px) {
  .content { padding: 16px; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .topbar { padding: 0 14px; gap: 8px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .welcome { padding: 20px; }
}

/* Search bar stacks below title on small screens (per spec) */
@media (max-width: 900px) {
  .content .page-search { display: flex; }
}
