/*
 * ApCon iOS Design System — "Proyectos en orden"
 * Clean, minimal, Apple-inspired mobile-first CSS
 */

/* ==========================================================================
   0. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Backgrounds */
  --bg-primary: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-dock: rgba(255, 255, 255, 0.72);
  --bg-input: #E5E5EA;

  /* Brand */
  --accent-primary: #E8853D;
  --accent-secondary: #D4722B;
  --accent-gold: #F5A623;

  /* Semantic */
  --success: #34C759;
  --danger: #FF3B30;
  --warning: #FF9500;
  --info: #007AFF;

  /* Text */
  --text-primary: #1C1C1E;
  --text-secondary: #8E8E93;
  --text-muted: #AEAEB2;
  --text-on-dark: #F9FAFB;

  /* Borders & Shadows */
  --border: rgba(0, 0, 0, 0.04);
  --border-separator: rgba(60, 60, 67, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-icon: 0 4px 12px rgba(0, 0, 0, 0.15);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;
  --radius-icon: 16px;

  /* Typography */
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;

  /* Transitions */
  --ease-ios: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.18s;
  --duration-normal: 0.3s;
  --duration-slow: 0.45s;
}

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: #000;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body::-webkit-scrollbar { display: none; }

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

a { text-decoration: none; color: var(--info); }
a:active { opacity: 0.6; }

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

/* ==========================================================================
   2. APP CONTAINER (iPhone frame on desktop)
   ========================================================================== */
.app-container {
  min-height: 100vh;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-primary);
  overflow: hidden;
}

/* When video background is active — override ALL design tokens */
.app-container.has-video-bg {
  /* Text colors → white variants */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255,255,255,0.75);
  --text-muted: rgba(255,255,255,0.5);
  --text-on-dark: #FFFFFF;

  /* Backgrounds → transparent glass */
  --bg-primary: transparent;
  --bg-secondary: rgba(255,255,255,0.06);
  --bg-card: rgba(0, 0, 0, 0.3);
  --bg-input: rgba(0, 0, 0, 0.25);
  --bg-dock: rgba(0, 0, 0, 0.3);

  /* Fallback premium background gradient if canvas is not visible or loading */
  background: radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 85% 85%, rgba(232, 133, 61, 0.15) 0%, transparent 50%),
              linear-gradient(135deg, #0F0F15 0%, #151522 50%, #0F0F15 100%);

  /* Borders → subtle white */
  --border: rgba(255,255,255,0.08);
  --border-separator: rgba(255,255,255,0.1);

  /* Shadows → darker for glass */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.3);
  --shadow-icon: 0 4px 16px rgba(0,0,0,0.25);
}

/* Ensure app-main is transparent */
.app-container.has-video-bg .app-main {
  background: transparent;
}
.app-container.has-video-bg .home-screen {
  color: #fff;
}
.app-container.has-video-bg .home-status-bar {
  color: rgba(255,255,255,0.85);
}
.app-container.has-video-bg .home-status-bar__time {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.app-container.has-video-bg .home-status-bar__brand {
  color: #F59E0B;
}
.app-container.has-video-bg .home-greeting h1,
.app-container.has-video-bg .home-greeting h2 {
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.app-container.has-video-bg .home-greeting p {
  color: rgba(255,255,255,0.7) !important;
}
.app-container.has-video-bg .home-app-icon__label {
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.app-container.has-video-bg .home-search .search-bar {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 14px;
}
.app-container.has-video-bg .search-bar__input {
  color: #fff;
}
.app-container.has-video-bg .search-bar__input::placeholder {
  color: rgba(255,255,255,0.5);
}
.app-container.has-video-bg .home-greeting-avatar {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

@media (min-width: 480px) {
  .app-container {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.25);
    border-left: 0.5px solid rgba(0, 0, 0, 0.1);
    border-right: 0.5px solid rgba(0, 0, 0, 0.1);
  }
}

.app-main {
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   3. HOME SCREEN
   ========================================================================== */
.home-screen {
  padding: 0 20px;
  padding-bottom: 160px;
  min-height: calc(100vh - 100px);
}

/* Status Bar */
.home-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 8px;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}

.home-status-bar__brand {
  font-weight: var(--weight-bold);
  color: var(--accent-primary);
  font-size: 13px;
  letter-spacing: -0.01em;
}

.home-status-bar__time {
  font-size: 15px;
  font-weight: 700;
  min-width: 70px;
  letter-spacing: 0.02em;
}

.home-status-bar__icons {
  font-size: 12px;
  min-width: 60px;
  text-align: right;
}

/* Greeting */
.home-greeting {
  padding: 16px 0 12px;
}

/* Search */
.home-search {
  margin-bottom: 20px;
}

/* App Grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 0;
  padding: 16px 0px 30px;
  justify-items: center;
}

/* App Icon */
.home-app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  transition: transform var(--duration-fast) var(--ease-ios);
}

.home-app-icon:active {
  transform: scale(0.85);
}

.home-app-icon__image {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-icon);
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast);
  position: relative;
  overflow: hidden;
}

.home-app-icon__image i {
  width: 30px;
  height: 30px;
}

/* Subtle shine overlay on icons */
.home-app-icon__image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  border-radius: var(--radius-icon) var(--radius-icon) 0 0;
  pointer-events: none;
}

.home-app-icon__label {
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  margin-top: 6px;
  text-align: center;
  line-height: 1.2;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Locked state */
.home-app-icon--locked {
  opacity: 0.45;
  filter: grayscale(0.5);
}

.home-app-icon__lock {
  position: absolute;
  top: -2px;
  right: 6px;
  font-size: 12px;
}

/* Notification badge */
.home-app-icon__badge {
  position: absolute;
  top: -3px;
  right: 8px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ==========================================================================
   3a. APP ICON GRADIENTS
   ========================================================================== */
.app-icon--dashboard { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.app-icon--projects  { background: linear-gradient(135deg, #E8853D 0%, #D4722B 100%); }
.app-icon--expenses  { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.app-icon--tasks     { background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%); }
.app-icon--gallery   { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.app-icon--reports   { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.app-icon--calculator{ background: linear-gradient(135deg, #636e72 0%, #2d3436 100%); }
.app-icon--quotes    { background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%); }
.app-icon--backup    { background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%); }
.app-icon--profile   { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.app-icon--employees { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

/* ==========================================================================
   3b. iOS DOCK
   ========================================================================== */
.home-dock {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 100px;
  background: var(--bg-dock);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 16px 20px;
  z-index: 90;
}

.home-dock__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-ios);
  -webkit-user-select: none;
  user-select: none;
}

.home-dock__item:active {
  transform: scale(0.85);
}

.home-dock__label {
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Glass dock when video bg is active */
.has-video-bg .home-dock {
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border-top: 0.5px solid rgba(255,255,255,0.1);
}
.has-video-bg .home-dock__label {
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Home Search Trigger (iOS style pill) */
#home-search-trigger {
  position: fixed;
  bottom: 115px; /* Floats exactly 15px above the 100px dock */
  left: 50%;
  transform: translateX(-50%);
  z-index: 91;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 6px 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#home-search-trigger:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

#home-search-trigger:active {
  transform: translateX(-50%) scale(0.95);
  background: rgba(255, 255, 255, 0.3);
}

#home-search-trigger span {
  font-size: 13px;
  color: #ffffff !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Home Indicator */
.home-indicator {
  position: fixed;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 3px;
  z-index: 95;
}

/* ==========================================================================
   4. APP VIEW (Full-screen overlay when an app is opened)
   ========================================================================== */
.app-view {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-view__header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 52px;
  background: rgba(242, 242, 247, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border-separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.app-view__back {
  display: flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 15px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  padding: 6px 2px;
  min-width: 60px;
  transition: opacity var(--duration-fast);
}

.app-view__back:active { opacity: 0.5; }

.app-view__title {
  font-size: 17px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  text-align: center;
  flex: 1;
}

.app-view__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-bottom: 40px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-view__content::-webkit-scrollbar { display: none; }

/* Better spacing in glass mode */
.has-video-bg .app-view__content {
  gap: 16px;
  padding: 20px;
  padding-bottom: 40px;
}

/* ── Glass App Views when video bg is active ── */
.has-video-bg .app-view {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.has-video-bg .app-view__header {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border-bottom: 0.5px solid rgba(255,255,255,0.12);
}

.has-video-bg .app-view__title {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.has-video-bg .app-view__back {
  color: #F59E0B;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* Cards — glass with high contrast text */
.has-video-bg .card,
.has-video-bg .card--glass {
  background: rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  color: #fff;
}

/* ALL text inside cards — bright and readable */
.has-video-bg .card *,
.has-video-bg .app-view__content * {
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.has-video-bg .card .text-secondary,
.has-video-bg .card .card__subtitle,
.has-video-bg .card label,
.has-video-bg .text-secondary,
.has-video-bg .app-view__content .text-secondary {
  color: rgba(255,255,255,0.8) !important;
  font-weight: 500;
}

.has-video-bg .card .text-primary,
.has-video-bg .card h3,
.has-video-bg .card h4,
.has-video-bg .card .font-bold,
.has-video-bg .card p,
.has-video-bg .card span,
.has-video-bg .card td,
.has-video-bg .card th,
.has-video-bg .card li,
.has-video-bg .app-view__content h1,
.has-video-bg .app-view__content h2,
.has-video-bg .app-view__content h3,
.has-video-bg .app-view__content h4,
.has-video-bg .app-view__content p,
.has-video-bg .app-view__content span,
.has-video-bg .app-view__content td,
.has-video-bg .app-view__content th,
.has-video-bg .app-view__content li {
  color: #fff;
}

/* Accent text — bright gold */
.has-video-bg .card .text-accent,
.has-video-bg .text-accent,
.has-video-bg .app-view__content .text-accent {
  color: #FCD34D !important;
  font-weight: 600;
}

/* Stat values — extra prominent */
.has-video-bg .stat-value,
.has-video-bg [class*="stat"] [class*="value"],
.has-video-bg .card h2 {
  color: #fff !important;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  font-size: 110%;
}

.has-video-bg .stat-label,
.has-video-bg [class*="stat"] [class*="label"] {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* Danger/Success/Warning colors — brighter */
.has-video-bg .text-danger {
  color: #FCA5A5 !important;
}
.has-video-bg .text-success {
  color: #86EFAC !important;
}
.has-video-bg .text-warning {
  color: #FDE68A !important;
}

/* Dark card variant */
.has-video-bg .card--dark {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Buttons — glow effect */
.has-video-bg .btn--primary {
  box-shadow: 0 4px 20px rgba(232, 133, 61, 0.4);
  font-weight: 700;
}

/* Inputs — darker glass for readability */
.has-video-bg input,
.has-video-bg select,
.has-video-bg textarea,
.has-video-bg .form-input,
.has-video-bg .form-select,
.has-video-bg .form-textarea {
  background: rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18) !important;
  color: #fff !important;
  font-weight: 500;
}

.has-video-bg .form-input:focus,
.has-video-bg .form-select:focus,
.has-video-bg .form-textarea:focus,
.has-video-bg input:focus,
.has-video-bg textarea:focus {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(232, 133, 61, 0.25) !important;
}

.has-video-bg input::placeholder,
.has-video-bg textarea::placeholder,
.has-video-bg .form-input::placeholder {
  color: rgba(255,255,255,0.45) !important;
}

/* Form labels */
.has-video-bg .form-label {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Profile upload label */
.has-video-bg .profile-upload-label {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Tables */
.has-video-bg table {
  color: #fff;
}
.has-video-bg th {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.has-video-bg td {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Separators */
.has-video-bg hr,
.has-video-bg .divider {
  border-color: rgba(255,255,255,0.12);
}

/* Tabs / Filter chips */
.has-video-bg .tabs {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}

.has-video-bg .tab {
  color: rgba(255,255,255,0.7);
}

.has-video-bg .tab--active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Search bars inside app views */
.has-video-bg .app-view .search-bar,
.has-video-bg .search-bar {
  background: rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15) !important;
}

.has-video-bg .app-view .search-bar__icon,
.has-video-bg .search-bar__icon {
  color: rgba(255,255,255,0.6);
}

.has-video-bg .app-view .search-bar__input,
.has-video-bg .search-bar__input {
  color: #fff !important;
}

.has-video-bg .app-view .search-bar__input::placeholder,
.has-video-bg .search-bar__input::placeholder {
  color: rgba(255,255,255,0.45) !important;
}

/* Badges */
.has-video-bg .badge {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  font-weight: 700;
}

.has-video-bg .badge--ejecucion { background: rgba(232, 133, 61, 0.25); color: #FCD34D; }
.has-video-bg .badge--cotizacion,
.has-video-bg .badge--info { background: rgba(59, 130, 246, 0.25); color: #93C5FD; }
.has-video-bg .badge--pausado,
.has-video-bg .badge--neutral { background: rgba(156, 163, 175, 0.25); color: #D1D5DB; }
.has-video-bg .badge--finalizado,
.has-video-bg .badge--success { background: rgba(34, 197, 94, 0.25); color: #86EFAC; }
.has-video-bg .badge--cancelado,
.has-video-bg .badge--danger { background: rgba(239, 68, 68, 0.25); color: #FCA5A5; }
.has-video-bg .badge--warning { background: rgba(245, 158, 11, 0.25); color: #FDE68A; }

/* Empty states */
.has-video-bg [class*="empty"],
.has-video-bg [class*="no-results"],
.has-video-bg [class*="placeholder"] {
  color: rgba(255,255,255,0.7) !important;
}

/* List items */
.has-video-bg .list-item,
.has-video-bg [class*="list"] [class*="item"] {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Modals — solid glass for readability */
.has-video-bg .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.has-video-bg .modal {
  background: rgba(15, 15, 20, 0.85) !important;
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
}

.has-video-bg .modal__header {
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.has-video-bg .modal__handle {
  background: rgba(255,255,255,0.3);
}

.has-video-bg .modal__close {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.has-video-bg .modal__body {
  color: #fff;
}

.has-video-bg .modal__footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
}

.has-video-bg .modal h2,
.has-video-bg .modal h3,
.has-video-bg .modal h4,
.has-video-bg .modal label,
.has-video-bg .modal p,
.has-video-bg .modal span,
.has-video-bg .modal td,
.has-video-bg .modal th {
  color: #fff !important;
}

/* Select dropdowns */
.has-video-bg select option {
  background: #1a1a2e;
  color: #fff;
}

/* Chip / pill buttons */
.has-video-bg .chip,
.has-video-bg [class*="filter"] button,
.has-video-bg [class*="chip"] {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.12);
}

.has-video-bg .chip--active,
.has-video-bg [class*="filter"] button.active,
.has-video-bg [class*="chip"].active {
  background: rgba(232, 133, 61, 0.3);
  color: #FCD34D;
  border-color: rgba(232, 133, 61, 0.5);
  font-weight: 700;
}

/* Progress bars */
.has-video-bg [class*="progress"] {
  background: rgba(255,255,255,0.1);
}

/* Icons inside views */
.has-video-bg .app-view__content i,
.has-video-bg .app-view__content svg {
  color: rgba(255,255,255,0.7);
  stroke: rgba(255,255,255,0.7);
}

/* ==========================================================================
   5. CARDS (Clean iOS style)
   ========================================================================== */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: none;
  transition: transform var(--duration-fast) var(--ease-ios);
}

.card--dark {
  background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%);
  color: var(--text-on-dark);
}

.card--dark .card__subtitle,
.card--dark .text-secondary { color: #98989D; }

.card--glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card--highlight {
  border-left: 3px solid var(--accent-primary);
}

.card--danger {
  border-left: 3px solid var(--danger);
}

.card--success {
  border-left: 3px solid var(--success);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card__title {
  font-size: 15px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.card__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.card__body { font-size: var(--text-sm); }

.card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border-separator);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ==========================================================================
   6. iOS-STYLE LIST
   ========================================================================== */
.ios-list {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ios-list__item {
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border-separator);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--duration-fast);
}

.ios-list__item:last-child { border-bottom: none; }
.ios-list__item:active { background: rgba(0, 0, 0, 0.03); }

.ios-list__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ios-list__content { flex: 1; min-width: 0; }
.ios-list__title { font-size: 15px; font-weight: var(--weight-medium); }
.ios-list__subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 1px; }
.ios-list__trailing { color: var(--text-muted); font-size: 14px; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ==========================================================================
   7. SECTION HEADERS
   ========================================================================== */
.section-header {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  padding: 20px 4px 8px;
}

/* ==========================================================================
   8. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: opacity var(--duration-fast), transform var(--duration-fast);
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
  line-height: 1.2;
}

.btn:active {
  opacity: 0.7;
  transform: scale(0.97);
}

.btn--primary {
  background: var(--accent-primary);
  color: white;
}

.btn--secondary {
  background: rgba(232, 133, 61, 0.1);
  color: var(--accent-primary);
}

.btn--danger {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}

.btn--success {
  background: rgba(52, 199, 89, 0.1);
  color: var(--success);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--ios {
  background: transparent;
  color: var(--info);
  padding: 8px 4px;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: 16px 28px;
  font-size: 17px;
}

.btn--full { width: 100%; }

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.fab {
  position: fixed;
  bottom: 100px;
  right: calc(50% - 195px);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
  color: white;
  border: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(232, 133, 61, 0.35);
  cursor: pointer;
  z-index: 50;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.fab:active { transform: scale(0.9); }

@media (max-width: 430px) {
  .fab { right: 20px; }
}

/* ==========================================================================
   9. FORMS (iOS Settings style)
   ========================================================================== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  transition: background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  background: var(--bg-card);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(232, 133, 61, 0.15);
}

.form-input--error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12) !important;
}

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

.form-helper {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row > .form-group { flex: 1; margin-bottom: 0; }

.form-currency-input-wrapper {
  position: relative;
}

.form-currency-input-wrapper::before {
  content: '$';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}

.form-currency-input-wrapper .form-input {
  padding-left: 30px;
}

/* ==========================================================================
   10. PROGRESS BARS
   ========================================================================== */
.progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s var(--ease-ios);
  position: relative;
}

.progress-bar__fill--green { background: var(--success); }
.progress-bar__fill--orange { background: var(--warning); }
.progress-bar__fill--red { background: var(--danger); }

/* ==========================================================================
   11. BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  white-space: nowrap;
}

.badge--cotizacion, .badge--info { background: rgba(0, 122, 255, 0.1); color: #007AFF; }
.badge--ejecucion { background: rgba(232, 133, 61, 0.12); color: var(--accent-primary); }
.badge--pausado, .badge--neutral { background: rgba(142, 142, 147, 0.12); color: #8E8E93; }
.badge--finalizado, .badge--success { background: rgba(52, 199, 89, 0.1); color: #34C759; }
.badge--cancelado, .badge--danger { background: rgba(255, 59, 48, 0.1); color: #FF3B30; }
.badge--warning { background: rgba(255, 149, 0, 0.12); color: #FF9500; }

/* ==========================================================================
   12. STATS GRID
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.stat-card.card--dark {
  background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%) !important;
  color: var(--text-on-dark) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.card--dark .stat-card__label {
  color: rgba(255, 255, 255, 0.6) !important;
}

.stat-card.card--dark .stat-card__value {
  color: var(--text-on-dark) !important;
}

.stat-card.card--dark .text-muted,
.stat-card.card--dark [style*="color: var(--text-muted)"] {
  color: rgba(255, 255, 255, 0.45) !important;
}

.stat-card__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: var(--weight-medium);
}

.stat-card__value {
  font-size: 22px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-card__icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  opacity: 0.12;
}

/* ==========================================================================
   13. COUNTDOWN
   ========================================================================== */
.countdown-display {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-md);
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  min-width: 44px;
}

.countdown-number {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #fff !important;
}

.countdown-label {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.6) !important;
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
}

.countdown-separator {
  font-size: 18px;
  font-weight: var(--weight-bold);
  color: rgba(255, 255, 255, 0.4);
  animation: blink 1.2s infinite;
}

/* ==========================================================================
   14. TABS (iOS Segmented Control)
   ========================================================================== */
.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  padding: 2px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1;
  padding: 8px 14px;
  border-radius: calc(var(--radius-sm) - 1px);
  font-size: 13px;
  font-weight: var(--weight-semibold);
  text-align: center;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-ios);
}

.tab--active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tab-content { padding-top: 14px; }

/* ==========================================================================
   15. SEARCH BAR
   ========================================================================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  padding: 10px 14px;
}

.search-bar__icon {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 15px;
}

.search-bar__input {
  background: transparent;
  border: none;
  flex: 1;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
}

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

/* ==========================================================================
   16. MODALS (iOS Action Sheet)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn var(--duration-fast) var(--ease-ios);
}

.modal {
  background: var(--bg-card);
  border-radius: 14px 14px 0 0;
  max-height: 92vh;
  width: 100%;
  max-width: 430px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp var(--duration-normal) var(--ease-ios);
}

.modal__header {
  padding: 16px;
  text-align: center;
  border-bottom: 0.5px solid var(--border-separator);
  flex-shrink: 0;
  position: relative;
}

.modal__handle {
  width: 36px;
  height: 5px;
  background: #D1D1D6;
  border-radius: 3px;
  margin: 0 auto 10px;
}

.modal__title {
  font-size: 17px;
  font-weight: var(--weight-semibold);
}

.modal__close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal__body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal__footer {
  padding: 12px 16px;
  border-top: 0.5px solid var(--border-separator);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   17. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 400px;
  padding: 0 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: var(--weight-medium);
  animation: slideDown var(--duration-normal) var(--ease-ios);
  pointer-events: auto;
  border: 0.5px solid var(--border-separator);
}

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

/* ==========================================================================
   18. GALLERY
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal);
}

.gallery-item:active img { transform: scale(1.05); }

.gallery-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.gallery-categories::-webkit-scrollbar { display: none; }

.gallery-category {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.gallery-category--active {
  background: var(--accent-primary);
  color: white;
}

/* Glass filter pills */
.has-video-bg .gallery-category {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.1);
}

.has-video-bg .gallery-category--active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 12px rgba(232, 133, 61, 0.35);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox img {
  max-width: 95%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   19. LOGIN VIEW
   ========================================================================== */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  width: 100%;
  animation: fadeIn var(--duration-normal) var(--ease-ios);
}

.login-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 4s ease-in-out infinite;
}

.login-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 28px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-users-list {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: none;
  justify-content: center;
  flex-wrap: wrap;
}

.login-users-list::-webkit-scrollbar { display: none; }

.login-user-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  min-width: 72px;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.login-user-avatar:active { transform: scale(0.92); }

.login-user-avatar--selected div:first-child,
.login-user-avatar--selected img {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(232, 133, 61, 0.25) !important;
}

/* PIN Dots */
.login-pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}

.login-pin-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-input);
  background: transparent;
  transition: all var(--duration-fast) var(--ease-ios);
}

.login-pin-dot--filled {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.15);
}

/* Numpad */
.login-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.login-numpad__key {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  font-size: 24px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background var(--duration-fast), transform var(--duration-fast);
}

.login-numpad__key:active {
  background: var(--bg-input);
  transform: scale(0.92);
}

.login-numpad__key--action {
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  color: var(--text-secondary);
}

/* ── Glass Login when video bg is active ── */
.has-video-bg .login-container {
  background: transparent;
}

.has-video-bg .login-numpad__key {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.12);
}

.has-video-bg .login-numpad__key:active {
  background: rgba(255,255,255,0.3);
}

.has-video-bg .login-numpad__key--action {
  background: transparent;
  border: none;
  box-shadow: none;
  color: rgba(255,255,255,0.7);
}

.has-video-bg .login-pin-dot {
  border-color: rgba(255,255,255,0.4);
}

.has-video-bg .login-pin-dot--filled {
  background: #F59E0B;
  border-color: #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.has-video-bg .login-subtitle {
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================================
   20. EMPTY STATES
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state__icon {
  font-size: 48px;
  opacity: 0.25;
  margin-bottom: 12px;
}

.empty-state__title {
  font-size: 17px;
  font-weight: var(--weight-semibold);
  margin-bottom: 6px;
}

.empty-state__text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 260px;
}

/* ==========================================================================
   21. CHART CONTAINERS
   ========================================================================== */
.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.chart-container--half { height: 200px; }
.chart-container--full { height: 280px; }

/* ==========================================================================
   22. CALCULATOR (Construction specific)
   ========================================================================== */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast);
}

.calc-card:active { transform: scale(0.96); }

.calc-card__icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.calc-card__title {
  font-size: 14px;
  font-weight: var(--weight-semibold);
}

.calc-result {
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}

.calc-result__value {
  font-size: 28px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

.calc-result__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* ==========================================================================
   23. ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes iconTap {
  0% { transform: scale(1); }
  50% { transform: scale(0.82); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.animate-fade-in { animation: fadeIn var(--duration-normal) var(--ease-ios); }
.animate-slide-up { animation: slideUp var(--duration-normal) var(--ease-ios); }
.animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-spring); }

/* ==========================================================================
   24. SPINNER
   ========================================================================== */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 0, 0, 0.06);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, rgba(0,0,0,0.04) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   25. UTILITIES
   ========================================================================== */
.hidden { display: none !important; }
.visible { display: block; }

/* Flexbox */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Gaps */
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* Spacing */
.mt-xs { margin-top: 4px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 16px; }
.mt-xl { margin-top: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }

.mb-xs { margin-bottom: 4px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.mb-4 { margin-bottom: 16px; }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Sizing */
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Typography */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.text-primary-color { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

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

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link styling */
.link { color: var(--accent-primary); font-weight: var(--weight-semibold); }
.link:active { opacity: 0.6; }

/* Dividers */
.divider {
  height: 0.5px;
  background: var(--border-separator);
  margin: 12px 0;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.alert-success { background: rgba(52, 199, 89, 0.1); color: var(--success); }
.alert-danger { background: rgba(255, 59, 48, 0.1); color: var(--danger); }
.alert-warning { background: rgba(255, 149, 0, 0.1); color: var(--warning); }
.alert-info { background: rgba(0, 122, 255, 0.1); color: var(--info); }

/* Block display helper */
.block { display: block; }

/* Avatar circle */
.avatar-circle {
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  color: white;
}

/* iOS separator */
.ios-separator {
  height: 0.5px;
  background: var(--border-separator);
  margin-left: 60px;
}

/* Scrollbar hide */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ==========================================================================
   26. RESPONSIVE
   ========================================================================== */
@media (max-width: 374px) {
  .home-grid { gap: 16px 0; }
  
  .login-numpad__key {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }
}

@media (min-width: 768px) {
  html { background: #1a1a1a; }
  
  .app-container {
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 40px;
    overflow: hidden;
    min-height: calc(100vh - 40px);
  }
}

/* ==========================================================================
   27. ACCESSIBILITY
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) { outline: none; }

/* ==========================================================================
   28. PROFILE PHOTO UPLOAD & USER EDIT STYLES
   ========================================================================== */
.profile-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  position: relative;
}

.profile-upload-preview {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background-color: var(--bg-input);
  background-size: cover;
  background-position: center;
  border: 3px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 32px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-fast) var(--ease-ios);
}

.profile-upload-preview:hover {
  transform: scale(1.03);
  border-color: var(--accent-secondary);
}

.profile-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-upload-label {
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
  cursor: pointer;
  padding: 6px 12px;
  background: rgba(232, 133, 61, 0.08);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast);
}

.profile-upload-label:hover {
  background: rgba(232, 133, 61, 0.15);
}

/* User avatar on Home greeting */
.home-greeting-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 12px;
}

.home-greeting-wrapper .home-greeting {
  padding: 0;
  flex: 1;
}

.home-greeting-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  border: 2px solid var(--bg-secondary);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.home-greeting-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Edit action icon on lists */
.btn-edit-user {
  background: rgba(0, 122, 255, 0.08);
  color: var(--info);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.btn-edit-user:hover {
  background: rgba(0, 122, 255, 0.15);
  transform: scale(1.08);
}

.btn-edit-user:active {
  transform: scale(0.95);
}

/* Cancel edit button */
.btn--cancel-edit {
  background: var(--bg-input);
  color: var(--text-secondary);
}

/* Active user selection border on login */
.login-user-avatar--selected img {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(232, 133, 61, 0.25) !important;
}

/* Premium Dark Modern App Icons */
.app-icon--premium-dark {
  background: linear-gradient(135deg, #24242e 0%, #101014 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06),
              0 6px 16px rgba(0, 0, 0, 0.5),
              0 2px 4px rgba(0, 0, 0, 0.4) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s var(--ease-ios), box-shadow 0.2s var(--ease-ios) !important;
}

.home-app-icon:active .app-icon--premium-dark,
.home-dock__item:active .app-icon--premium-dark {
  transform: scale(0.90) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8),
              0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

