/* =============================================================================
   urops_style.css — Urops Business Operations Suite
   Version: 1.0
   Last updated: May 2026
   Theme: Dark professional — deep navy / teal accent / warm white
   Fonts: DM Serif Display + DM Sans + DM Mono
   Priority: Mobile-first (390px base), scales to desktop ≥768px
   ============================================================================= */


/* =============================================================================
   SECTION 1: DESIGN TOKENS
   ============================================================================= */

:root {

  /* --- Color Palette --- */

  /* Base surfaces */
  --bg-deepest:   #080c14;
  --bg-deep:      #0c1220;
  --bg-mid:       #101828;
  --bg-raised:    #162035;
  --bg-elevated:  #1c2840;
  --bg-hover:     #1a2638;

  /* Borders */
  --border-subtle:  #1e2f48;
  --border-base:    #253a58;
  --border-strong:  #2e4870;

  /* Teal accent */
  --teal-bright:  #2dd4bf;
  --teal-mid:     #14b8a6;
  --teal-muted:   #0d9488;
  --teal-faint:   rgba(45, 212, 191, 0.08);
  --teal-glow:    rgba(45, 212, 191, 0.15);

  /* Text hierarchy */
  --text-primary:   #f0f4f8;
  --text-body:      #b8c4d4;
  --text-secondary: #7a8fa8;
  --text-muted:     #4a5a70;
  --text-inverse:   #080c14;
  --text-teal:      #2dd4bf;

  /* Status */
  --status-active:      #34d399;
  --status-active-bg:   rgba(52, 211, 153, 0.10);
  --status-inactive:    #60a5fa;
  --status-inactive-bg: rgba(96, 165, 250, 0.10);
  --status-warn:        #fbbf24;
  --status-warn-bg:     rgba(251, 191, 36, 0.10);
  --status-danger:      #f87171;
  --status-danger-bg:   rgba(248, 113, 113, 0.10);

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

  /* --- Border Radius --- */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  20px;
  --r-pill: 999px;

  /* --- Typography --- */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', 'Helvetica Neue', sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 15px;
  --text-md:   17px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;
  --text-3xl:  38px;

  --leading-tight:  1.2;
  --leading-snug:   1.4;
  --leading-normal: 1.6;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.6);
  --shadow-teal: 0 0 20px rgba(45, 212, 191, 0.12);

  /* --- Transitions --- */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 350ms ease;

  /* --- Layout --- */
  --sidebar-width:    240px;
  --topbar-height:    56px;
  --bottomnav-height: 64px;

  /* --- Z-Index --- */
  --z-base:    1;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-toast:   300;
}


/* =============================================================================
   SECTION 2: RESET & BASE
   ============================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;          /* definite height so body can fill it */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-body);
  background-color: var(--bg-deepest);
  -webkit-font-smoothing: antialiased;
  height: 100%;          /* definite height so #app flex children get constrained height */
  min-height: 100dvh;    /* fallback: never shorter than viewport */
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  word-break: break-word;
  overflow-wrap: break-word;
}

code, pre, .mono {
  font-family: var(--font-mono);
  word-break: normal;
  overflow-wrap: normal;
}

a {
  color: var(--text-teal);
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

ul, ol { list-style: none; }

img, svg {
  display: block;
  max-width: 100%;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
}


/* =============================================================================
   SECTION 3: AUTH SCREEN
   ============================================================================= */

#auth-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deepest);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--sp-6);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(45, 212, 191, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(45, 212, 191, 0.03) 0%, transparent 50%);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-mid);
  border: 1px solid var(--border-base);
  border-radius: var(--r-2xl);
  padding: var(--sp-8) var(--sp-6);
  box-shadow: var(--shadow-lg), var(--shadow-teal);
}

.auth-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
  letter-spacing: -0.02em;
}

.auth-tagline {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--sp-7);
}

.auth-teal-bar {
  width: 32px;
  height: 2px;
  background: var(--teal-bright);
  border-radius: var(--r-pill);
  margin: 0 auto var(--sp-7);
  box-shadow: var(--shadow-teal);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: var(--sp-6);
  line-height: var(--leading-normal);
}

.auth-error {
  font-size: var(--text-sm);
  color: var(--status-danger);
  text-align: center;
  margin-top: var(--sp-3);
}

.auth-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--sp-4);
  line-height: var(--leading-normal);
}


/* =============================================================================
   SECTION 4: LAYOUT SHELL
   ============================================================================= */

#app {
  display: flex;
  flex-direction: column;
  height: 100%;          /* definite height — enables overflow-y:auto on #main-content */
  min-height: 100dvh;    /* never shorter than viewport */
}

/* Sidebar hidden on mobile */
#sidebar {
  display: none;
}

/* Topbar — mobile */
#topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-raised);
  height: var(--topbar-height);
  background: var(--bg-deepest);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  flex-shrink: 0;
}

.topbar-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.topbar-tier-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-bright);
  background: var(--teal-faint);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--r-pill);
  padding: 2px var(--sp-3);
}

/* Main content */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottomnav-height) + var(--sp-6));
  background: var(--bg-deepest);
}

/* Bottom nav */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-raised);
  height: var(--bottomnav-height);
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  min-width: 0;
  color: var(--text-secondary);
}

.nav-item:active {
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--teal-bright);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--teal-bright);
  border-radius: 0 0 var(--r-pill) var(--r-pill);
  box-shadow: var(--shadow-teal);
}

.nav-item-icon {
  font-size: 18px;
  line-height: 1;
  transition: color var(--t-fast);
}

.nav-item-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--t-fast);
}


/* =============================================================================
   SECTION 5: TAB PANELS
   ============================================================================= */

.tab-panel {
  display: none;
  padding: var(--sp-5) var(--sp-4);
  animation: fadeUp 180ms ease forwards;
  /* overflow-x removed — body + #main-content already guard horizontal jitter.
     This was clipping .table-wrap overflow-x:auto, cutting off action buttons
     in the last column on narrow screens. Known Issue 010 fix. */
  width: 100%;
  box-sizing: border-box;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tab-header {
  margin-bottom: var(--sp-5);
}

.tab-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-bright);
  margin-bottom: var(--sp-1);
}

.tab-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.tab-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--sp-1);
}

.tab-actions {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}


/* =============================================================================
   SECTION 6: DASHBOARD
   ============================================================================= */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.dash-card {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.dash-card:active {
  background: var(--bg-hover);
  border-color: var(--border-base);
}

.dash-card--primary {
  border-color: rgba(45, 212, 191, 0.2);
  background: var(--teal-faint);
}

.dash-card-icon {
  font-size: 20px;
  margin-bottom: var(--sp-2);
  line-height: 1;
}

.dash-card-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-1);
}

.dash-card-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-section {
  margin-bottom: var(--sp-6);
}

.dash-section-title {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-body);
  transition: background var(--t-fast), border-color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}

.quick-action-btn:active {
  background: var(--bg-hover);
  border-color: var(--border-base);
}


/* =============================================================================
   SECTION 7: CARDS & ITEM LIST
   ============================================================================= */

.card {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.item-card {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.item-card:active {
  background: var(--bg-hover);
  border-color: var(--border-base);
}

.item-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.item-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--leading-snug);
}

.item-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.item-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.item-card-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--teal-bright);
  font-weight: 500;
}

.item-card-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}


/* =============================================================================
   SECTION 8: BADGES & STATUS
   ============================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--active {
  background: var(--status-active-bg);
  color: var(--status-active);
}

.badge--inactive {
  background: var(--status-inactive-bg);
  color: var(--status-inactive);
}

.badge--warn {
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

.badge--danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--sp-3);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-bright);
  background: var(--teal-faint);
  border: 1px solid rgba(45, 212, 191, 0.2);
}


/* =============================================================================
   SECTION 9: FORMS & INPUTS
   ============================================================================= */

.form-group {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--status-danger);
  margin-top: var(--sp-1);
}

.input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--teal-mid);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}

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

.input--date {
  color-scheme: dark;
}

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8fa8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-8);
  cursor: pointer;
}

.search-wrap {
  margin-bottom: var(--sp-4);
}


/* =============================================================================
   SECTION 10: BUTTONS
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  border: none;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--teal-mid);
  color: var(--text-inverse);
}

.btn-primary:active {
  background: var(--teal-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-base);
}

.btn-ghost:active {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:active {
  background: rgba(248, 113, 113, 0.2);
}

.btn-sm {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
}

.btn.loading {
  opacity: 0.6;
  pointer-events: none;
}


/* =============================================================================
   SECTION 11: MODALS
   ============================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.85);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-mid);
  border: 1px solid var(--border-base);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform var(--t-base);
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal--sm {
  max-height: 50dvh;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: background var(--t-fast);
  flex-shrink: 0;
}

.modal-close:active {
  background: var(--bg-hover);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.modal-footer .btn {
  flex: 1;
}

.confirm-message {
  font-size: var(--text-base);
  color: var(--text-body);
  line-height: var(--leading-normal);
}


/* =============================================================================
   SECTION 12: MORE TRAY
   ============================================================================= */

.more-tray {
  background: var(--bg-mid);
  border: 1px solid var(--border-base);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  width: 100%;
  max-width: 600px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translateY(20px);
  transition: transform var(--t-base);
}

.modal-overlay.open .more-tray {
  transform: translateY(0);
}

.more-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}

.more-tray-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.more-tray-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.more-tray-items {
  padding: var(--sp-3) var(--sp-3) var(--sp-5);
}

.more-tray-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  transition: background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}

.more-tray-item:active {
  background: var(--bg-hover);
}

.more-tray-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.more-tray-label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.more-tray-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}


/* =============================================================================
   SECTION 13: PAYROLL CONTROLS
   ============================================================================= */

.payroll-controls {
  margin-bottom: var(--sp-4);
}

.payroll-summary-card {
  background: var(--teal-faint);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.payroll-summary-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-bright);
  margin-bottom: var(--sp-1);
}

.payroll-summary-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.payroll-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.payroll-line {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.payroll-line-label {
  color: var(--text-secondary);
}

.payroll-line-value {
  font-family: var(--font-mono);
  color: var(--text-body);
  font-size: var(--text-sm);
}

.payroll-line--total .payroll-line-label {
  font-weight: 600;
  color: var(--text-primary);
}

.payroll-line--total .payroll-line-value {
  color: var(--teal-bright);
  font-weight: 500;
}

.payroll-line--deduction .payroll-line-value {
  color: var(--status-danger);
}


/* =============================================================================
   SECTION 14: PAYSLIP PRINT
   ============================================================================= */

#payslip-print-view {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  background: white;
  overflow-y: auto;
  padding: 24px;
}

#payslip-print-view.visible {
  display: block;
}

.payslip-print-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.payslip-document {
  max-width: 600px;
  margin: 0 auto;
  font-family: 'DM Sans', sans-serif;
  color: #111;
}

.payslip-header {
  text-align: center;
  border-bottom: 2px solid #111;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.payslip-company {
  font-size: 18px;
  font-weight: 700;
}

.payslip-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  margin-top: 4px;
}

.payslip-period {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

.payslip-employee-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.payslip-info-label {
  color: #555;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.payslip-info-value {
  font-weight: 600;
  color: #111;
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}

.payslip-table th {
  background: #f5f5f5;
  padding: 8px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  border-bottom: 1px solid #ddd;
}

.payslip-table td {
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.payslip-table .amount {
  text-align: right;
  font-family: 'DM Mono', monospace;
}

.payslip-net {
  background: #111;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.payslip-net-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.payslip-net-value {
  font-size: 20px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
}

.payslip-signature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 32px;
}

.payslip-sig-line {
  border-top: 1px solid #111;
  padding-top: 8px;
  font-size: 11px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media print {
  #payslip-print-view .payslip-print-close { display: none; }
  body > *:not(#payslip-print-view) { display: none; }
  #payslip-print-view { position: static; padding: 0; }
}


/* =============================================================================
   SECTION 15: SETTINGS
   ============================================================================= */

.settings-section {
  margin-bottom: var(--sp-4);
}

.settings-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal-bright);
  margin-bottom: var(--sp-4);
}

.settings-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
}

.settings-info-row:last-child {
  border-bottom: none;
}

.settings-info-label {
  color: var(--text-secondary);
}

.settings-info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.settings-info-value.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.danger-zone {
  border-color: rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.03);
}

.danger-zone-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--status-danger);
  margin-bottom: var(--sp-2);
}

.danger-zone-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}


/* =============================================================================
   SECTION 16: TOAST NOTIFICATIONS
   ============================================================================= */

#toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + var(--sp-3));
  left: var(--sp-4);
  right: var(--sp-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 200ms ease forwards;
  pointer-events: auto;
}

.toast--success {
  background: var(--status-active-bg);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--status-active);
}

.toast--error {
  background: var(--status-danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--status-danger);
}

.toast--warn {
  background: var(--status-warn-bg);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--status-warn);
}

.toast--info {
  background: var(--bg-raised);
  border: 1px solid var(--border-base);
  color: var(--text-body);
}

.toast.dismissing {
  animation: toastOut 200ms ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}


/* =============================================================================
   SECTION 17: UTILITIES
   ============================================================================= */

.hidden { display: none !important; }

.mono { font-family: var(--font-mono); }

.text-teal { color: var(--teal-bright); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--status-danger); }

.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); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.flex-1 { flex: 1; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-base);
  border-radius: var(--r-pill);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  gap: var(--sp-3);
}

.empty-state-icon {
  font-size: 40px;
  line-height: 1;
  opacity: 0.5;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 260px;
  line-height: var(--leading-normal);
}


/* =============================================================================
   SECTION 18: DESKTOP LAYOUT (≥768px)
   ============================================================================= */

@media (min-width: 768px) {

  #topbar { display: none; }
  #bottom-nav { display: none; }

  #app {
    flex-direction: row;
  }

  #sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    background: var(--bg-deep);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
  }

  .sidebar-header {
    padding: var(--sp-7) var(--sp-6) var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }

  .sidebar-wordmark {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--text-primary);
    letter-spacing: -0.02em;
  }

  .sidebar-tagline {
    font-size: var(--text-xs);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: var(--sp-1);
  }

  .sidebar-tier {
    padding: var(--sp-3) var(--sp-6);
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-nav {
    flex: 1;
    padding: var(--sp-4) var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: background var(--t-fast);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-nav-item:hover {
    background: var(--bg-hover);
  }

  .sidebar-nav-item.active {
    background: var(--teal-faint);
    border: 1px solid rgba(45, 212, 191, 0.15);
  }

  .sidebar-nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    transition: color var(--t-fast);
  }

  .sidebar-nav-item.active .nav-icon,
  .sidebar-nav-item:hover .nav-icon {
    color: var(--teal-bright);
  }

  .sidebar-nav-item .nav-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--t-fast);
  }

  .sidebar-nav-item.active .nav-label {
    color: var(--teal-bright);
    font-weight: 600;
  }

  .sidebar-nav-item:hover .nav-label {
    color: var(--text-body);
  }

  .sidebar-footer {
    padding: var(--sp-4) var(--sp-3);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }

  #main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: var(--sp-8);
  }

  .tab-panel {
    padding: var(--sp-7) var(--sp-8);
    max-width: 800px;
  }

  .modal {
    border-radius: var(--r-xl);
    align-self: center;
    margin: auto;
    max-height: 85dvh;
  }

  .modal-overlay {
    align-items: center;
  }

  .more-tray {
    border-radius: var(--r-xl);
    max-width: 480px;
    align-self: center;
    margin: auto;
  }

  .dash-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }

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

  #toast-container {
    top: var(--sp-5);
    left: calc(var(--sidebar-width) + var(--sp-5));
    right: var(--sp-5);
    max-width: 400px;
  }
}


/* =============================================================================
   SECTION 19: TABLE VIEW, EXPORT, LOANS, DTR SUMMARY
   Contracts 1, 2, 5, 6, 10, 11
   ============================================================================= */


/* -----------------------------------------------------------------------------
   19.1 — Module toolbar (search + export button row)
   ----------------------------------------------------------------------------- */

.module-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.module-toolbar .search-wrap {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-raised);
  border: 1px solid var(--border-base);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-export:active,
.btn-export:hover {
  background: var(--teal-faint);
  border-color: rgba(45, 212, 191, 0.3);
  color: var(--teal-bright);
}

.btn-export-icon {
  font-size: 14px;
  line-height: 1;
}


/* -----------------------------------------------------------------------------
   19.2 — Scrollable table wrapper
   Apple aesthetic: no visible border on wrapper, content breathes,
   horizontal scroll on narrow screens with momentum scrolling
   ----------------------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-mid);
}

/* Subtle fade hint on right edge when table overflows horizontally */
.table-wrap-outer {
  position: relative;
}

.table-wrap-outer::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--bg-deepest));
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base);
}

.table-wrap-outer.overflows::after {
  opacity: 1;
}


/* -----------------------------------------------------------------------------
   19.3 — Base table
   ----------------------------------------------------------------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  min-width: 480px; /* forces horizontal scroll on mobile before collapsing */
}

/* Header row */
.data-table thead tr {
  border-bottom: 1px solid var(--border-base);
}

.data-table thead th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: var(--z-base);
}

.data-table thead th:first-child {
  border-radius: var(--r-lg) 0 0 0;
}

.data-table thead th:last-child {
  border-radius: 0 var(--r-lg) 0 0;
  text-align: right;
}

/* Sortable column header */
.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}

.data-table thead th.sortable:hover {
  color: var(--text-body);
}

.data-table thead th.sort-asc::after  { content: ' ↑'; color: var(--teal-bright); }
.data-table thead th.sort-desc::after { content: ' ↓'; color: var(--teal-bright); }

/* Body rows */
.data-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-fast);
}

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

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

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

/* Cells */
.data-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-body);
  vertical-align: middle;
  line-height: var(--leading-snug);
}

.data-table tbody td:last-child {
  text-align: right;
}

/* Primary cell — employee name, main identifier */
.data-table .td-primary {
  font-weight: 600;
  color: var(--text-primary);
}

/* Mono cell — numbers, IDs, amounts */
.data-table .td-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-body);
}

/* Amount cell — peso values */
.data-table .td-amount {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
}

/* Muted cell — secondary info */
.data-table .td-muted {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* Actions cell — edit/close buttons */
.data-table .td-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  align-items: center;
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.table-action-btn--edit {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.table-action-btn--edit:active,
.table-action-btn--edit:hover {
  background: var(--teal-faint);
  color: var(--teal-bright);
  border-color: rgba(45, 212, 191, 0.2);
}

.table-action-btn--close {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: rgba(248, 113, 113, 0.2);
}

.table-action-btn--close:active,
.table-action-btn--close:hover {
  background: rgba(248, 113, 113, 0.2);
}

/* Row count label */
.table-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-1);
}


/* -----------------------------------------------------------------------------
   19.4 — DTR Summary — Quick View (inside employee modal)
   ----------------------------------------------------------------------------- */

.dtr-summary-section {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
}

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

.dtr-summary-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal-bright);
}

.dtr-period-select {
  font-size: var(--text-xs);
  padding: var(--sp-1) var(--sp-3);
  padding-right: var(--sp-6);
  background: var(--bg-raised);
  border: 1px solid var(--border-base);
  border-radius: var(--r-sm);
  color: var(--text-body);
  cursor: pointer;
}

/* 2×4 stat grid — clean Apple-style metric tiles */
.dtr-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.dtr-stat-tile {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dtr-stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

.dtr-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
}

/* Accent tiles for key metrics */
.dtr-stat-tile--ot .dtr-stat-value   { color: var(--teal-bright); }
.dtr-stat-tile--late .dtr-stat-value { color: var(--status-warn); }
.dtr-stat-tile--absent .dtr-stat-value { color: var(--status-danger); }


/* -----------------------------------------------------------------------------
   19.5 — DTR Summary — Full Audit View (inside DTR module)
   ----------------------------------------------------------------------------- */

.dtr-audit-toolbar {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
  align-items: flex-end;
}

.dtr-audit-toolbar .form-group {
  margin-bottom: 0;
  min-width: 140px;
  flex: 1;
}

.dtr-audit-totals {
  background: var(--teal-faint);
  border: 1px solid rgba(45, 212, 191, 0.15);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.dtr-audit-total-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dtr-audit-total-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-bright);
  opacity: 0.7;
}

.dtr-audit-total-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Day status badges inside DTR audit table */
.dtr-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dtr-status-badge--present  { background: var(--status-active-bg);   color: var(--status-active); }
.dtr-status-badge--absent   { background: var(--status-danger-bg);   color: var(--status-danger); }
.dtr-status-badge--late     { background: var(--status-warn-bg);     color: var(--status-warn); }
.dtr-status-badge--holiday  { background: var(--status-inactive-bg); color: var(--status-inactive); }
.dtr-status-badge--rest     { background: var(--bg-elevated);        color: var(--text-secondary); }
.dtr-status-badge--halfday  { background: var(--status-warn-bg);     color: var(--status-warn); }


/* -----------------------------------------------------------------------------
   19.6 — Loans section (inside employee modal — Contract 6)
   ----------------------------------------------------------------------------- */

.loans-section {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
}

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

.loans-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal-bright);
}

/* Individual loan card inside employee modal */
.loan-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-2);
  transition: border-color var(--t-fast);
}

.loan-card:last-child {
  margin-bottom: 0;
}

.loan-card--closed {
  opacity: 0.5;
}

.loan-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.loan-card-type {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.loan-card-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.loan-amount-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loan-amount-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.loan-amount-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 500;
}

/* Balance progress bar */
.loan-progress-wrap {
  margin-bottom: var(--sp-3);
}

.loan-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}

.loan-progress-track {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.loan-progress-fill {
  height: 100%;
  background: var(--teal-mid);
  border-radius: var(--r-pill);
  transition: width var(--t-slow);
}

.loan-progress-fill--low {
  background: var(--status-warn);
}

/* Loan type badge variants */
.loan-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.loan-type-badge--sss    { background: rgba(96, 165, 250, 0.12);  color: var(--status-inactive); }
.loan-type-badge--pagibig { background: rgba(52, 211, 153, 0.10); color: var(--status-active); }
.loan-type-badge--office  { background: var(--status-warn-bg);    color: var(--status-warn); }


/* -----------------------------------------------------------------------------
   19.7 — Loans summary tab (M06 — Contract 10)
   ----------------------------------------------------------------------------- */

.loans-filter-bar {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  border: 1px solid var(--border-base);
  background: var(--bg-raised);
  color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--teal-faint);
  border-color: rgba(45, 212, 191, 0.3);
  color: var(--teal-bright);
}

.filter-chip:active {
  background: var(--bg-elevated);
}

/* Loans summary stats banner */
.loans-stats-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.loans-stat-card {
  background: var(--bg-mid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.loans-stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.loans-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.loans-stat-value--teal   { color: var(--teal-bright); }
.loans-stat-value--warn   { color: var(--status-warn); }
.loans-stat-value--danger { color: var(--status-danger); }


/* -----------------------------------------------------------------------------
   19.8 — Desktop overrides for new components (≥768px)
   ----------------------------------------------------------------------------- */

@media (min-width: 768px) {

  /* Wider min-width on desktop — table columns have more room */
  .data-table {
    min-width: unset;
    font-size: var(--text-base);
  }

  /* Toolbar stays on one line on desktop */
  .module-toolbar {
    flex-wrap: nowrap;
  }

  /* DTR stat grid goes 4-up on desktop */
  .dtr-stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Audit totals go 5-up on desktop */
  .dtr-audit-totals {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Loans stats banner stays 3-up — correct width */
  .loans-stats-banner {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Loan amounts in a tighter row on desktop */
  .loan-card-amounts {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Table action buttons show text on desktop */
  .table-action-btn {
    padding: var(--sp-2) var(--sp-3);
  }
}
