/*
  Rocket Time Entry
  File: /css/main.css
  Version: v0.1 (Rocket-only)
  Updated: 2026-02-16
*/

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

/* Base reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
img, video { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* Theme */
:root{
  /* Primary Colors - Professional Blue */
  --color-primary: #2563EB;
  --color-primary-50: #EFF6FF;
  --color-primary-100: #DBEAFE;
  --color-primary-200: #BFDBFE;
  --color-primary-300: #93C5FD;
  --color-primary-400: #60A5FA;
  --color-primary-500: #3B82F6;
  --color-primary-600: #2563EB;
  --color-primary-700: #1D4ED8;
  --color-primary-800: #1E40AF;
  --color-primary-900: #1E3A8A;
  --color-primary-foreground: #FFFFFF;

  /* Secondary Colors - Balanced Slate */
  --color-secondary: #64748B;
  --color-secondary-50: #F8FAFC;
  --color-secondary-100: #F1F5F9;
  --color-secondary-200: #E2E8F0;
  --color-secondary-300: #CBD5E1;
  --color-secondary-400: #94A3B8;
  --color-secondary-500: #64748B;
  --color-secondary-600: #475569;
  --color-secondary-700: #334155;
  --color-secondary-800: #1E293B;
  --color-secondary-900: #0F172A;
  --color-secondary-foreground: #FFFFFF;

  /* Background & Surface */
  --color-background: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F1F5F9;

  /* Text */
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #64748B;

  /* Borders */
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;

  /* Success/Error */
  --color-success: #16A34A;
  --color-success-50: #F0FDF4;
  --color-success-700: #15803D;

  --color-error: #DC2626;
  --color-error-50: #FEF2F2;
  --color-error-600: #DC2626;
  --color-error-700: #B91C1C;
  --color-error-900: #7F1D1D;

  /* Sizing & motion */
  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 10px 30px rgba(2,6,23,.10);
  --shadow-lg: 0 20px 55px rgba(2,6,23,.12);

  --height-button: 44px;

  --spacing-xs: .5rem;
  --spacing-sm: .75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.25rem;
  --spacing-xl: 1.75rem;

  --transition: 180ms ease;
}

/* Dark mode: add class="dark" on <html> or <body> */
.dark{
  --color-background: #0B1220;
  --color-surface: #0F172A;
  --color-surface-hover: #111C33;

  --color-text-primary: #E5E7EB;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #94A3B8;

  --color-border: #22314D;
  --color-border-strong: #2A3A58;
}

header h1 {
  line-height: 1.05;
  margin: 0;
}

header p {
  line-height: 1.1;
  margin: 0;
}

body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--color-background);
  color: var(--color-text-primary);
}

/* Typography helper classes used by the app */
.font-heading{ font-family: Outfit, Inter, system-ui, sans-serif; }
.font-caption{ font-family: "Source Sans 3", Inter, system-ui, sans-serif; }
.font-mono{ font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

/* App semantic tokens used in HTML */
.bg-background{ background: var(--color-background); }
.bg-surface{ background: var(--color-surface); }
.bg-surface-hover{ background: var(--color-surface-hover); }
.bg-error-600{ background: var(--color-error-600); }

.text-text-primary{ color: var(--color-text-primary); }
.text-text-secondary{ color: var(--color-text-secondary); }
.text-white{ color: #fff; }

.border{ border: 1px solid var(--color-border); }
.border-b{ border-bottom: 1px solid var(--color-border); }
.border-t{ border-top: 1px solid var(--color-border); }
.border-border{ border-color: var(--color-border); }

/* Components */
.card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.card:hover{ box-shadow: var(--shadow-md); }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--height-button);
  padding: 0 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }

.btn-primary{
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover{ box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn-outline{
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}
.btn-outline:hover{ background: var(--color-surface-hover); transform: translateY(-1px); }

.btn-accent{
  background: var(--color-success);
  color: #fff;
}
.btn-accent:hover{ transform: translateY(-1px); box-shadow: var(--shadow-md); }

.input,
input.input,
select.input,
textarea.input{
  width: 100%;
  padding: .6rem .75rem;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input:focus{
  border-color: var(--color-primary-300);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.dark .input:focus{ box-shadow: 0 0 0 4px rgba(96,165,250,.18); }

.table{
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td{
  border-bottom: 1px solid var(--color-border);
  padding: .65rem .5rem;
  vertical-align: top;
}
.table th{
  text-align: left;
  font-weight: 700;
  color: var(--color-text-secondary);
  font-size: .85rem;
  letter-spacing: .01em;
}
.table tr:hover td{ background: rgba(100,116,139,.06); }
.dark .table tr:hover td{ background: rgba(148,163,184,.08); }

.touch-target{ min-height: 48px; min-width: 48px; }

/* Export preview */
.preview-area{
  min-height: 420px;
  height: 60vh;
  max-height: 70vh;
  overflow: auto;
  resize: vertical;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: .75rem;
}

/* Small helpers used by the app */
.delete-row-btn{
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
}
.delete-row-btn:hover{ background: var(--color-error-50); border-color: rgba(220,38,38,.25); }
.dark .delete-row-btn:hover{ background: rgba(127,29,29,.35); }

.hours-input{ max-width: 6.5rem; }
.date-input{ max-width: 11rem; }
.desc-input{ min-width: 12rem; }

/* Utility classes (minimal subset used by your HTML) */
.block{ display:block; }
.hidden{ display:none; }
.fixed{ position:fixed; }

.flex{ display:flex; }
.grid{ display:grid; }
.flex-col{ flex-direction: column; }
.flex-wrap{ flex-wrap: wrap; }
.items-center{ align-items:center; }
.items-end{ align-items:flex-end; }
.justify-between{ justify-content:space-between; }
.flex-1{ flex: 1 1 0%; }

.gap-2{ gap: .5rem; }
.gap-3{ gap: .75rem; }
.gap-4{ gap: 1rem; }
.gap-6{ gap: 1.5rem; }

.grid-cols-1{ grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

.w-full{ width:100%; }
.w-4{ width:1rem; } .w-5{ width:1.25rem; } .w-6{ width:1.5rem; }
.w-10{ width:2.5rem; } .w-20{ width:5rem; } .w-28{ width:7rem; }
.w-32{ width:8rem; } .w-36{ width:9rem; }

.h-4{ height:1rem; } .h-5{ height:1.25rem; } .h-6{ height:1.5rem; }
.h-10{ height:2.5rem; } .h-20{ height:5rem; }

.p-4{ padding:1rem; }
.p-6{ padding:1.5rem; }
.p-8{ padding:2rem; }

.px-4{ padding-left:1rem; padding-right:1rem; }
.py-2{ padding-top:.5rem; padding-bottom:.5rem; }
.py-4{ padding-top:1rem; padding-bottom:1rem; }

.rounded-xl{ border-radius: 1rem; }
.rounded-2xl{ border-radius: 1.5rem; }
.whitespace-nowrap{ white-space: nowrap; }

.text-xs{ font-size:.75rem; }
.text-sm{ font-size:.875rem; }
.text-base{ font-size:1rem; }
.text-xl{ font-size:1.25rem; }
.font-medium{ font-weight:500; }
.font-semibold{ font-weight:600; }
.font-bold{ font-weight:700; }

.top-0{ top:0; }
.bottom-6{ bottom:1.5rem; }
.bottom-16{ bottom:4rem; }
.left-1\/2{ left:50%; }
.-translate-x-1\/2{ transform: translateX(-50%); }
.z-sticky{ z-index: 50; }
.z-\[9999\]{ z-index: 9999; }

.transition-colors{ transition: background var(--transition), color var(--transition), border-color var(--transition); }

/* Hover utility classes (escaped) */
.hover\:bg-surface-hover:hover{ background: var(--color-surface-hover); }
.hover\:bg-error-50:hover{ background: var(--color-error-50); }
.dark .dark\:hover\:bg-error-900:hover{ background: var(--color-error-900); }

/* Responsive utility subset used by your HTML (escaped selectors) */
@media (min-width: 640px){
  .sm\:px-6{ padding-left:1.5rem; padding-right:1.5rem; }
}
@media (min-width: 768px){
  .md\:hidden{ display:none; }
  .md\:flex{ display:flex; }
  .md\:grid-cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:col-span-2{ grid-column: span 2 / span 2; }
}
@media (min-width: 1024px){
  .lg\:grid-cols-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:col-span-3{ grid-column: span 3 / span 3; }
  .lg\:col-span-1{ grid-column: span 1 / span 1; }
 /* .lg\:grid-cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); } */
  .lg\:flex-row{ flex-direction: row; }
  .lg\:items-center{ align-items:center; }
  .lg\:items-end{ align-items:flex-end; }
  .lg\:justify-between{ justify-content:space-between; }
  .lg\:col-span-2{ grid-column: span 2 / span 2; }
  .lg\:px-8{ padding-left:2rem; padding-right:2rem; }
}

/* Arbitrary value utilities used by your HTML (escaped) */
.max-w-\[95vw\]{ max-width: 95vw; }
.min-h-\[48px\]{ min-height: 48px; }
.min-h-\[420px\]{ min-height: 420px; }


/* ---- Added minimal utilities used by app.html ---- */
.sticky{ position: sticky; }
.overflow-x-auto{ overflow-x: auto; }
.resize-none{ resize: none; }
.select-none{ user-select: none; }

.rounded-lg{ border-radius: .75rem; }

.shadow-lg{ box-shadow: var(--shadow-lg); }
.shadow-custom-sm{ box-shadow: var(--shadow-sm); }

.text-primary{ color: var(--color-primary); }
.text-error{ color: var(--color-error); }

.text-lg{ font-size: 1.125rem; }
.text-2xl{ font-size: 1.5rem; }
.text-4xl{ font-size: 2.25rem; }

.mt-1{ margin-top: .25rem; }
.mt-4{ margin-top: 1rem; }
.mb-2{ margin-bottom: .5rem; }

.ml-2{ margin-left: .5rem; }
.mr-2{ margin-right: .5rem; }
.ml-auto{ margin-left: auto; }
.mx-auto{ margin-left: auto; margin-right: auto; }
.mx-2{ margin-left: .5rem; margin-right: .5rem; }

.p-2{ padding: .5rem; }
.py-3{ padding-top: .75rem; padding-bottom: .75rem; }
.py-8{ padding-top: 2rem; padding-bottom: 2rem; }

.min-h-screen{ min-height: 100vh; }

/* Vertical spacing helpers */
.space-y-3 > :not([hidden]) ~ :not([hidden]){ margin-top: .75rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]){ margin-top: 1.5rem; }

/* Tabs */
.tab-inactive{ opacity: .7; }
.tab-inactive:hover{ opacity: 1; }

/* Width containers */
.max-w-7xl{ max-width: 80rem; }
.max-w-5xl{ max-width: 64rem; }

/* Manage view: lock status pills */
.lock-pill{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.25rem .6rem;
  border-radius:999px;
  font-weight:700;
  font-size:.78rem;
  border:1px solid var(--color-border);
  user-select:none;
  white-space:nowrap;
}

.lock-pill--locked{
  background: var(--color-error-50);
  color: var(--color-error-700);
  border-color: rgba(220,38,38,.25);
}

.lock-pill--unlocked{
  background: var(--color-success-50);
  color: var(--color-success-700);
  border-color: rgba(22,163,74,.25);
}

/* Mobile: keep the weekly table usable */
#viewWeekly .desc-input{ min-width: 260px; }
#viewWeekly .client-select{ min-width: 170px; }

/* ══════════════════════════════════════════════════════════
   MOBILE / TOUCH IMPROVEMENTS
   ══════════════════════════════════════════════════════════ */

/* Minimum touch target for all interactive elements */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    padding: 0 .875rem;
    font-size: .875rem;
  }

  .input, input, select, textarea {
    min-height: 44px;
    font-size: 16px !important; /* prevents iOS auto-zoom on focus */
  }

  /* Nav bar: tighter on small screens */
  .app-header .max-w-7xl {
    padding-left: .75rem;
    padding-right: .75rem;
  }

  /* Mobile menu links: full-width, tall touch targets */
  #mobileMenu a,
  #mobileMenu button {
    min-height: 48px;
    font-size: .95rem;
    width: 100%;
  }

  /* Cards: reduce padding on small screens */
  .card {
    padding: 14px !important;
  }

  /* Tables: always scroll horizontally, never shrink text to nothing */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: .8rem;
  }

  /* Page tab switchers: wrap on very small screens */
  .flex.gap-2.border-b {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  /* Stack flex rows that don't need to be side-by-side */
  .flex.flex-wrap.gap-3,
  .flex.flex-wrap.gap-4 {
    gap: .5rem;
  }

  /* Stat cards: 2 per row on phones */
  .lg\:grid-cols-4 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Full-width buttons in action bars */
  .status-bar .btn,
  .actions-bar .btn {
    flex: 1 1 auto;
  }
}
