@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Praxis light theme
   Two matching greens (brand + soft tint) and one contrasting orange accent.
   White surfaces, soft neutral borders, 10px radius, very light shadows —
   the pattern used by Stripe / Linear / Untitled UI style admin panels.
   Old variable names (--ink, --brass…) stay as aliases so every view works.
   ========================================================================== */
:root{
  /* brand greens */
  --green-900: #14532D;
  --green-800: #166534;
  --green-700: #15803D;   /* primary buttons, links */
  --green-600: #16A34A;
  --green-200: #BBF7D0;
  --green-100: #DCFCE7;   /* matching tint: active menu, chips */
  --green-50:  #F0FDF4;

  /* accent */
  --orange:      #EA580C; /* call-to-action, alerts */
  --orange-dark: #C2410C;
  --orange-tint: #FFF1E6;
  --orange-line: #FED7AA;

  /* neutrals */
  --page:  #F7F8FA;
  --card:  #FFFFFF;
  --line:  #EAECF0;
  --line-strong: #D0D5DD;
  --text:  #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98A2B3;
  --hover: #F9FAFB;

  --danger: #D92D20;  --danger-tint: #FEF3F2;  --danger-line: #FECDCA;
  --warn:   #B54708;  --warn-tint:   #FFFAEB;
  --info:   #175CD3;  --info-tint:   #EFF8FF;

  --radius: 12px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-lg: 0 12px 24px -6px rgba(16,24,40,0.10), 0 4px 8px -4px rgba(16,24,40,0.04);
  --ring: 0 0 0 4px rgba(22,163,74,0.14);

  /* legacy aliases */
  --ink: var(--text);
  --ink-soft: var(--text-2);
  --paper: var(--card);
  --paper-alt: var(--page);
  --brass: var(--orange);
  --brass-deep: var(--orange-dark);
  --brass-tint: var(--orange-tint);
  --slate: var(--text);
  --forest: var(--green-700);

  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #101828;
  --bs-primary: #15803D;
  --bs-primary-rgb: 21,128,61;
  --bs-link-color: #15803D;
  --bs-link-color-rgb: 21,128,61;
  --bs-link-hover-color: #166534;
  --bs-link-hover-color-rgb: 22,101,52;
  --bs-border-color: #EAECF0;
  --bs-secondary-color: #667085;
}
body{ background: var(--page); color: var(--text); font-size: 0.875rem; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6,.brand{ color: var(--text); font-weight: 600; letter-spacing: -0.015em; }
.h3, h1.h3{ font-size: 1.5rem; }
a{ text-decoration: none; }
.text-muted{ color: var(--muted) !important; }
::selection{ background: var(--green-100); }

/* ---------- shell ---------- */
.app-shell{ display: flex; min-height: 100vh; }
.app-sidebar{
  width: 264px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
  padding: 20px 0 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar::-webkit-scrollbar{ width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 6px; }
.brand-mark{ display: flex; align-items: center; gap: 10px; padding: 0 20px 18px; color: var(--text); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark:hover{ color: var(--text); }
.logo{ width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--green-600), var(--green-800)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; box-shadow: 0 2px 6px rgba(21,128,61,0.3); flex-shrink: 0; }
.brand-mark small{ display: block; font-size: 0.7rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.company-chip{
  margin: 0 14px 10px; padding: 10px 12px; background: var(--green-50); border: 1px solid var(--green-100);
  border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--green-800); display: flex; gap: 10px; align-items: center;
}
.company-chip .ci{ width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--green-700); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--green-100); flex-shrink: 0; }
.company-chip strong{ color: var(--text); display: block; font-size: 0.82rem; font-weight: 600; line-height: 1.2; }

.app-sidebar .nav-group{ padding: 16px 22px 6px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.app-sidebar nav a{
  display: flex; align-items: center; gap: 10px; margin: 1px 12px;
  padding: 8px 10px; color: var(--text-2); font-size: 0.875rem; font-weight: 500; border-radius: 8px;
  transition: background .12s ease, color .12s ease;
}
.app-sidebar nav a i{ font-size: 1.15rem; color: var(--faint); transition: color .12s ease; }
.app-sidebar nav a:hover{ background: var(--hover); color: var(--text); }
.app-sidebar nav a:hover i{ color: var(--muted); }
.app-sidebar nav a.active{ background: var(--green-50); color: var(--green-800); font-weight: 600; box-shadow: inset 3px 0 0 var(--green-600); }
.app-sidebar nav a.active i{ color: var(--green-700); }
.sidebar-foot{ margin-top: auto; padding: 12px 12px 0; border-top: 1px solid var(--line); }
.user-card{ display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.user-card .meta{ flex: 1; min-width: 0; font-size: 0.75rem; color: var(--muted); line-height: 1.25; }
.user-card .meta strong{ display: block; color: var(--text); font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .signout{ color: var(--faint); font-size: 1.15rem; padding: 6px; border-radius: 8px; line-height: 1; }
.user-card .signout:hover{ background: var(--danger-tint); color: var(--danger); }

.app-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar{
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  height: 64px; padding: 0 32px; background: rgba(255,255,255,0.88); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar-left, .topbar-right{ display: flex; align-items: center; gap: 12px; }
.topbar-title{ font-size: 0.875rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.topbar-title strong{ color: var(--text); font-weight: 600; }
.menu-toggle{ display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 36px; height: 36px; font-size: 1.2rem; color: var(--text-2); align-items: center; justify-content: center; }
.icon-btn{ position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: var(--shadow-xs); }
.icon-btn:hover{ background: var(--hover); color: var(--text); }
.icon-btn .count{ position: absolute; top: -6px; right: -6px; background: var(--orange); color: #fff; font-size: 0.62rem; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.who-btn{ display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 6px 4px 4px; border-radius: 12px; font-size: 0.78rem; color: var(--muted); text-align: left; }
.who-btn:hover{ background: var(--hover); }
.who-btn strong{ color: var(--text); display: block; line-height: 1.15; font-weight: 600; font-size: 0.84rem; }
.who-btn::after{ display: none; }
.avatar{ width: 36px; height: 36px; border-radius: 50%; background: var(--green-100); color: var(--green-800); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.8rem; flex-shrink: 0; }
.app-content{ padding: 28px 32px 48px; flex: 1; width: 100%; max-width: 1440px; }

/* ---------- page furniture ---------- */
.page-head{ display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-head h1{ margin-top: 4px; }
.page-head p{ color: var(--muted); margin: 4px 0 0; }
.kicker{ font-size: 0.78rem; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.kicker::before{ content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.role-pill{ background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }

.card-panel{ background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-panel:has(> .table){ overflow-x: auto; }
.card-panel .panel-head{ display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-panel .panel-head h2{ font-size: 0.95rem; font-weight: 600; margin: 0; }
.card-panel .panel-head a{ font-size: 0.8rem; font-weight: 600; color: var(--green-700); }
.card-panel .panel-head a:hover{ color: var(--green-900); }
.card-panel .panel-body{ padding: 16px 20px; }
.card-panel .table{ margin-bottom: 0; }
.card-panel .table > :not(caption) > * > *{ padding: 12px 20px; }
.card-panel .table-sm > :not(caption) > * > *{ padding: 9px 20px; }
.card-panel .table > thead > tr > th:first-child{ border-top-left-radius: var(--radius); }
.card-panel .table > thead > tr > th:last-child{ border-top-right-radius: var(--radius); }
.card-panel .table > tbody > tr:last-child > *{ border-bottom: 0; }
.card-panel.p-4{ padding: 28px !important; }

.stat-block{ background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; height: 100%; position: relative; box-shadow: var(--shadow-xs); transition: box-shadow .15s ease, border-color .15s ease; }
.stat-block .ico{ width: 40px; height: 40px; border-radius: 10px; background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 14px; }
.stat-block .num{ font-size: 1.75rem; color: var(--text); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.stat-block .cap{ font-size: 0.82rem; color: var(--muted); margin-top: 4px; font-weight: 500; }
.stat-block .sub{ font-size: 0.75rem; color: var(--faint); margin-top: 8px; }
.stat-block.alert-on .ico{ background: var(--orange-tint); color: var(--orange-dark); border-color: var(--orange-line); }
.stat-block.alert-on .num{ color: var(--orange-dark); }
.stat-block.alert-on::after, .stat-block.danger-on::after{ content: ''; position: absolute; top: 20px; right: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-tint); }
.stat-block.danger-on .ico{ background: var(--danger-tint); color: var(--danger); border-color: var(--danger-line); }
.stat-block.danger-on .num{ color: var(--danger); }
.stat-block.danger-on::after{ background: var(--danger); box-shadow: 0 0 0 4px var(--danger-tint); }
a.stat-link{ color: inherit; display: block; height: 100%; }
a.stat-link:hover .stat-block{ border-color: var(--line-strong); box-shadow: var(--shadow-lg); }

.bar{ height: 8px; background: #F2F4F7; border-radius: 6px; overflow: hidden; display: flex; gap: 2px; }
.bar > span{ display: block; height: 100%; border-radius: 4px; }
.legend-dot{ width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.empty-note{ color: var(--muted); font-size: 0.85rem; padding: 28px 18px; text-align: center; }

.table{ --bs-table-hover-bg: var(--hover); --bs-table-color: var(--text-2); border-color: var(--line); }
.table thead th{
  font-size: 0.75rem; color: var(--muted); font-weight: 500; background: var(--hover);
  border-bottom: 1px solid var(--line); white-space: nowrap; letter-spacing: 0;
}
.table td{ vertical-align: middle; font-size: 0.875rem; border-color: var(--line); }
.table tbody tr:hover > *{ background: var(--hover); }
.table td.text-center.text-muted.py-4{ padding: 40px 20px !important; }

/* ---------- badges (soft pill style) ---------- */
.badge{ font-weight: 500; font-size: 0.75rem; border-radius: 16px; padding: 0.3em 0.7em; border: 1px solid transparent; }
.badge-status-active, .badge-task-completed, .badge-invoice-paid, .badge-att-present{ background: var(--green-50); color: var(--green-800); border-color: var(--green-100); }
.badge-status-disabled, .badge-status-suspended, .badge-task-cancelled, .badge-priority-urgent, .badge-invoice-overdue, .badge-att-absent{ background: var(--danger-tint); color: #B42318; border-color: var(--danger-line); }
.badge-status-archived, .badge-status-inactive, .badge-task-on_hold, .badge-priority-low, .badge-invoice-draft, .badge-att-holiday, .badge-att-week_off{ background: #F2F4F7; color: var(--text-2); border-color: var(--line); }
.badge-invoice-cancelled, .badge-att-none{ background: #F9FAFB; color: var(--faint); border-color: var(--line); }
.badge-task-open, .badge-priority-medium, .badge-invoice-sent, .badge-att-work_from_home{ background: var(--info-tint); color: var(--info); border-color: #B2DDFF; }
.badge-task-in_progress, .badge-priority-high, .badge-invoice-partially_paid, .badge-att-half_day{ background: var(--orange-tint); color: var(--orange-dark); border-color: var(--orange-line); }
.badge-att-leave{ background: var(--warn-tint); color: var(--warn); border-color: #FEDF89; }
.badge.bg-secondary{ background: #F2F4F7 !important; color: var(--text-2); }

/* ---------- buttons ---------- */
.btn{ border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem; padding: 0.5rem 0.95rem; box-shadow: var(--shadow-xs); transition: background .12s ease, border-color .12s ease, color .12s ease; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-sm{ font-size: 0.8rem; padding: 0.34rem 0.7rem; border-radius: 8px; }
.btn-lg{ padding: 0.7rem 1.2rem; }
.btn:focus-visible{ box-shadow: var(--ring); }
.btn-brass{ background: var(--orange); border: 1px solid var(--orange); color: #fff; }
.btn-brass:hover, .btn-brass:focus{ background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn-ink, .btn-primary{ background: var(--green-700); border: 1px solid var(--green-700); color: #fff; }
.btn-ink:hover, .btn-primary:hover, .btn-ink:focus, .btn-primary:focus{ background: var(--green-800); border-color: var(--green-800); color: #fff; }
.btn-outline-secondary{ background: #fff; border: 1px solid var(--line-strong); color: var(--text-2); }
.btn-outline-secondary:hover, .btn-outline-secondary:focus{ background: var(--hover); border-color: var(--line-strong); color: var(--text); }
.btn-outline-danger{ background: #fff; border-color: var(--danger-line); color: var(--danger); }
.btn-outline-danger:hover{ background: var(--danger-tint); border-color: var(--danger-line); color: #B42318; }
.btn-success{ background: var(--green-600); border-color: var(--green-600); }
.btn-danger{ background: var(--danger); border-color: var(--danger); }
.btn-link{ box-shadow: none; }

/* ---------- forms ---------- */
.form-control, .form-select{ border-radius: var(--radius-sm); border-color: var(--line-strong); color: var(--text); padding: 0.55rem 0.8rem; font-size: 0.875rem; box-shadow: var(--shadow-xs); }
.form-control-sm, .form-select-sm{ border-radius: 8px; padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.form-select{ padding-right: 2.2rem; }
.form-control::placeholder{ color: var(--faint); }
.form-control:focus, .form-select:focus{ border-color: #86D9A5; box-shadow: var(--ring); }
.form-label{ font-weight: 500; font-size: 0.82rem; color: var(--text-2); margin-bottom: 6px; }
.form-text{ color: var(--muted); font-size: 0.76rem; }
.form-check-input:checked{ background-color: var(--green-700); border-color: var(--green-700); }
.form-check-input:focus{ box-shadow: var(--ring); border-color: #86D9A5; }
.input-group-text{ background: var(--hover); border-color: var(--line-strong); color: var(--muted); }

/* ---------- alerts, menus, modals ---------- */
.alert{ border-radius: var(--radius-sm); border: 1px solid; font-size: 0.86rem; }
.alert-success{ background: var(--green-50); border-color: var(--green-200); color: var(--green-900); }
.alert-danger{ background: var(--danger-tint); border-color: var(--danger-line); color: #912018; }
.alert-warning{ background: var(--warn-tint); border-color: #FEDF89; color: #93370D; }
.alert-info{ background: var(--info-tint); border-color: #B2DDFF; color: #194185; }
.dropdown-menu{ border-radius: var(--radius-sm); border-color: var(--line); box-shadow: var(--shadow-lg); padding: 6px; font-size: 0.86rem; }
.dropdown-item{ border-radius: 6px; padding: 7px 10px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.dropdown-item:hover{ background: var(--hover); }
.dropdown-item:active{ background: var(--green-50); color: var(--green-800); }
.modal-content{ border: 0; border-radius: 16px; box-shadow: 0 24px 48px -12px rgba(16,24,40,0.18); }
.modal-header, .modal-footer{ border-color: var(--line); padding: 16px 20px; }
.modal-body{ padding: 20px; }
.modal-title{ font-size: 1.05rem; }
.page-link{ color: var(--text-2); border-color: var(--line); }
.active > .page-link{ background: var(--green-50); border-color: var(--green-200); color: var(--green-800); }

.device-active{ display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--green-700); font-weight: 500; }
.device-active .dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); display: inline-block; box-shadow: 0 0 0 3px var(--green-100); }
.device-none{ color: var(--faint); font-size: 0.82rem; }

/* ---------- login ---------- */
.login-wrap{ min-height: 100vh; display: flex; background: #fff; }
.login-form-side{ flex: 1; display: flex; flex-direction: column; padding: 32px 48px; }
.login-card{ width: 100%; max-width: 380px; margin: auto; padding: 24px 0; }
.login-card h1{ font-size: 1.85rem; font-weight: 600; margin: 0 0 8px; }
.login-card p.lede{ color: var(--muted); font-size: 0.92rem; margin: 0 0 28px; }
.login-card .form-control{ padding: 0.65rem 0.85rem; }
.login-foot{ font-size: 0.78rem; color: var(--faint); }
.pw-wrap{ position: relative; }
.pw-wrap .form-control{ padding-right: 2.6rem; }
.pw-wrap .pw-toggle{ position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); font-size: 1.15rem; padding: 6px; border-radius: 6px; line-height: 1; }
.pw-wrap .pw-toggle:hover{ color: var(--text-2); }
.login-side{
  flex: 1.1; margin: 16px; border-radius: 24px; padding: 56px 52px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 88% 8%, #FFEDD5 0, transparent 36%), linear-gradient(160deg, #F0FDF4 0%, #DCFCE7 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.login-side h2{ color: var(--green-900); font-size: 2.1rem; line-height: 1.2; max-width: 460px; font-weight: 700; letter-spacing: -0.025em; }
.login-side h2 em{ color: var(--orange); font-style: normal; }
.login-side p{ color: var(--green-800); max-width: 440px; font-size: 0.95rem; margin: 14px 0 0; }
.preview-cards{ display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; max-width: 480px; }
.preview-card{ background: rgba(255,255,255,0.88); border: 1px solid #fff; border-radius: 14px; padding: 16px; box-shadow: 0 8px 24px -10px rgba(20,83,45,0.18); }
.preview-card i{ width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--green-50); color: var(--green-700); font-size: 1.1rem; margin-bottom: 10px; }
.preview-card.accent i{ background: var(--orange-tint); color: var(--orange-dark); }
.preview-card strong{ display: block; color: var(--text); font-size: 0.9rem; font-weight: 600; }
.preview-card span{ font-size: 0.78rem; color: var(--muted); }

/* ---------- responsive ---------- */
.sidebar-backdrop{ display: none; }
@media (max-width: 991px){
  .app-sidebar{ position: fixed; left: 0; top: 0; z-index: 1040; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .app-sidebar{ transform: none; }
  body.sidebar-open .sidebar-backdrop{ display: block; position: fixed; inset: 0; background: rgba(16,24,40,0.35); z-index: 1030; }
  .menu-toggle{ display: inline-flex; }
  .app-topbar{ padding: 0 16px; height: 58px; }
  .app-content{ padding: 20px 16px 36px; }
  .who-btn .name, .topbar-title{ display: none !important; }
  .login-side{ display: none; }
  .login-form-side{ padding: 24px; }
}
@media (max-width: 575px){
  .page-head{ align-items: flex-start; }
  .h3, h1.h3{ font-size: 1.3rem; }
  .stat-block .num{ font-size: 1.45rem; }
}
