/* LVLLine shared product UI — responsive overrides for the existing app. */
:root {
  --primary: #FD6B34;
  --primary-dark: #c83f12;
  --primary-light: #ff7b4f;
  --bg: #f4f5f2;
  --bg-secondary: #eceee9;
  --card-bg: #fff;
  --border: #dfe3dc;
  --border-light: #edf0eb;
  --text-main: #18201b;
  --text-muted: #667068;
  --text-light: #929a94;
  --success: #16865a;
  --danger: #c73b32;
  --warning: #d58a0a;
  --info: #2563a9;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 28, 23, .06);
  --shadow-md: 0 8px 28px rgba(20, 28, 23, .08);
  --shadow-lg: 0 18px 48px rgba(20, 28, 23, .14);
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(circle at 12% -12%, rgba(241, 90, 41, .08), transparent 25rem),
    var(--bg);
  color: var(--text-main);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -.006em;
}

button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid rgba(241, 90, 41, .28); outline-offset: 2px; }

.navbar {
  background: rgba(22, 28, 24, .96);
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
}
.navbar-inner { max-width: 1440px; }
.navbar-brand img { height: 32px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.25)); }
.nav-menu a { border-radius: 10px; color: rgba(255,255,255,.78); }
.nav-menu a:hover { color: #fff; background: rgba(255,255,255,.08); }

.page-wrapper { max-width: 1440px; padding: 20px clamp(16px, 3vw, 38px) 104px; }
.page-header { align-items: center; margin-bottom: 24px !important; }
.page-header-title, h1, h2, h3 { letter-spacing: -.035em; }
.page-header-title { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.logo-section { display: none !important; }

.card, .subdivision-card, .project-card, .mobile-card {
  border: 1px solid rgba(27, 40, 31, .08);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}
.card { padding: clamp(16px, 2.5vw, 24px); }
.card:hover { border-color: rgba(27, 40, 31, .12); }
.card-header { border: 0; padding: 0; }
.card-title { font-size: 1.05rem; }
.card-subtitle { color: var(--text-muted); line-height: 1.55; }

.btn {
  min-height: 46px;
  border-radius: 12px;
  padding: 11px 18px;
  color: #fff !important;
  background: var(--primary);
  box-shadow: 0 2px 0 rgba(87, 26, 7, .18);
  font-weight: 700;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-secondary { background: #27312b; color: #fff !important; }
.btn-secondary:hover { background: #111713; }
.btn-danger { background: var(--danger); }
.btn-ghost { color: var(--text-main) !important; background: transparent; box-shadow: none; }
.btn-sm { min-height: 42px; padding: 9px 14px; }

label { font-weight: 700; color: #384139; margin-bottom: 7px; }
input[type="text"], input[type="date"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], select, textarea {
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #ccd2cb;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(20, 28, 23, .03);
}
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(241, 90, 41, .11);
}

.status-pill, .pill { border-radius: 999px; font-weight: 700; }
.table-container { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table { background: #fff; }
th { background: #f7f8f5; color: #536057; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }

.project-card { position: relative; overflow: hidden; padding: 20px; }
.project-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary); opacity: .75; }
.project-card:hover { border-color: rgba(241,90,41,.25); box-shadow: var(--shadow-md); }
.project-card-name { font-size: 1.05rem; letter-spacing: -.02em; }

.mobile-tabbar { display: none; }
.eyebrow { display:block; color:var(--primary-dark); font-size:.72rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; margin-bottom:8px; }
.home-hero { display:flex; align-items:end; justify-content:space-between; gap:28px; padding:clamp(22px,5vw,48px); margin-bottom:18px; border-radius:24px; color:#fff; background:linear-gradient(125deg,#172019 0%,#29362e 72%,#3d493f 100%); box-shadow:var(--shadow-md); overflow:hidden; position:relative; }
.home-hero::after { content:""; position:absolute; width:240px; height:240px; right:-70px; top:-100px; border-radius:50%; border:46px solid rgba(241,90,41,.2); }
.home-hero > * { position:relative; z-index:1; }
.home-hero .eyebrow { color:#ff9a78; }
.home-hero h1 { margin:0; font-size:clamp(2rem,6vw,3.7rem); line-height:.98; max-width:700px; }
.home-hero p { color:rgba(255,255,255,.7); max-width:620px; margin:16px 0 0; font-size:clamp(1rem,2vw,1.14rem); }
.home-hero__actions { display:flex; flex-wrap:wrap; gap:10px; flex-shrink:0; }
.home-hero__actions .btn-secondary { background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2); }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:18px; }
.metric-card { display:flex; flex-direction:column; min-height:155px; padding:20px; border-radius:18px; background:#fff; border:1px solid rgba(27,40,31,.08); color:var(--text-main); box-shadow:var(--shadow-sm); text-decoration:none; }
.metric-card:hover { text-decoration:none; transform:translateY(-2px); box-shadow:var(--shadow-md); }
.metric-card--accent { background:#fff5f0; border-color:rgba(241,90,41,.18); }
.metric-card__label { color:var(--text-muted); font-weight:700; font-size:.84rem; }
.metric-card strong { margin:7px 0 auto; font-size:2.4rem; line-height:1; letter-spacing:-.06em; }
.metric-card__link { color:var(--primary-dark); font-size:.78rem; font-weight:800; }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:18px; }
.section-heading h2 { margin:0; font-size:1.35rem; }
.action-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.action-tile { display:flex; align-items:center; gap:13px; min-height:80px; padding:14px; color:var(--text-main); background:#f7f8f5; border:1px solid var(--border-light); border-radius:14px; text-decoration:none; }
.action-tile:hover { text-decoration:none; background:#fff; border-color:rgba(241,90,41,.25); }
.action-tile__mark { display:grid; place-items:center; flex:0 0 38px; height:38px; border-radius:11px; color:#fff; background:#27312b; font-size:1.1rem; font-weight:800; }
.action-tile strong,.action-tile small { display:block; }
.action-tile small { color:var(--text-muted); margin-top:2px; }

@media (max-width: 767px) {
  body { font-size: 15px; }
  .navbar { min-height: 58px; padding: calc(9px + var(--safe-top)) 16px 9px; }
  .navbar-brand img { height: 31px; }
  .nav-toggle { width: 42px; height: 42px; }
  .nav-menu {
    top: calc(58px + var(--safe-top));
    bottom: 0;
    width: 100vw;
    height: calc(100dvh - 58px - var(--safe-top));
    padding: 14px 16px calc(28px + var(--safe-bottom));
    background: rgba(18, 24, 20, .985);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    z-index: 1250;
  }
  .nav-menu.active { display: flex; flex-direction: column; }
  .nav-menu a { min-height: 50px; font-size: 1rem; padding: 13px 14px; }
  .nav-divider { display: block; }
  .nav-dropdown { flex: 0 0 auto; }
  .nav-dropdown-content {
    position: static;
    width: 100%;
    margin: 4px 0 12px;
    box-shadow: none;
  }

  .page-wrapper { padding: 18px 14px calc(92px + var(--safe-bottom)); }
  .page-header { gap: 12px; }
  .page-header-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header-actions > * { width: 100%; }
  .card { margin-bottom: 14px; }
  .form-row { grid-template-columns: 1fr !important; gap: 12px; }
  .quick-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions .btn { width: 100%; min-width: 0; }
  .projects-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .subdivision-card { padding: 14px !important; }
  .subdivision-card-header { margin-bottom: 12px !important; }
  .project-tabs { overflow-x: auto; scrollbar-width: none; }
  .project-tab { min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
  .modal { width: calc(100vw - 20px) !important; max-height: calc(100dvh - 24px); border-radius: 20px !important; }
  .modal-body { overflow-y: auto; }

  .mobile-tabbar {
    position: fixed;
    z-index: 1200;
    left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: calc(66px + var(--safe-bottom));
    padding: 7px 0 var(--safe-bottom);
    background: rgba(255,255,255,.96);
    border-top: 1px solid rgba(28, 37, 31, .1);
    box-shadow: 0 -8px 26px rgba(25, 34, 28, .08);
    backdrop-filter: blur(18px);
  }
  .mobile-tabbar__item {
    appearance: none;
    border: 0;
    background: transparent;
    color: #778079;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 2px;
    font-size: .67rem;
    line-height: 1.1;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    min-width: 0;
    position: relative;
  }
  .mobile-tabbar__item + .mobile-tabbar__item { border-left: 1px solid rgba(28, 37, 31, .08); }
  .mobile-tabbar__item:hover { text-decoration: none; }
  .mobile-tabbar__item.is-active { color: var(--primary); }
  .mobile-tabbar__icon { font-size: 1.25rem; line-height: 1; font-weight: 800; }
  .home-hero { align-items:stretch; flex-direction:column; padding:24px 20px; border-radius:20px; }
  .home-hero h1 { font-size:2.35rem; }
  .home-hero__actions { display:grid; grid-template-columns:1fr 1fr; }
  .home-hero__actions .btn { width:100%; padding-left:10px; padding-right:10px; }
  .metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .metric-card { min-height:125px; padding:14px 11px; }
  .metric-card strong { font-size:2rem; }
  .metric-card__link { font-size:.67rem; }
  .action-grid { grid-template-columns:1fr; }
  .section-heading > .text-muted { display:none; }
  body.nav-open .mobile-tabbar { display: none; }
}

@media (min-width: 768px) {
  .page-wrapper { padding-top: 30px; }
  .navbar { padding: 10px 28px; }
  .dashboard-grid { gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
