@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;600;700;800&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root{
  --orange:#EA9A21;
  --orange-dark:#C97F14;
  --charcoal:#58585A;
  --ink:#2A2A2C;
  --cream:#FAF8F4;
  --card:#FFFFFF;
  --line:#E6E1D8;
  --muted:#8B8681;
  --good:#3E7D5C;
  --warn:#C0392B;
}
*{box-sizing:border-box;}
html,body{margin:0; padding:0; overflow-x:hidden; max-width:100%;}
body{background:var(--cream);}
#natluc-root{
  font-family:'Hanken Grotesk',sans-serif;
  color:var(--ink);
  min-height:100vh;
  position:relative;
  overflow-x:hidden;
}
h1,h2,h3,h4{font-family:'Bricolage Grotesque',sans-serif; margin:0; letter-spacing:-0.01em;}

/* ---------- Auth screen ---------- */
#auth-screen{
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  background:var(--cream);
  padding:20px;
  position:relative;
}
#auth-screen::before{
  content:"";
  position:fixed;
  top:-120px; right:-160px;
  width:520px; height:640px;
  background:
    linear-gradient(135deg, transparent 0 46%, var(--orange) 46% 50%, transparent 50% 100%),
    linear-gradient(45deg, transparent 0 46%, var(--charcoal) 46% 50%, transparent 50% 100%);
  opacity:0.06;
  pointer-events:none;
}
.login-card{
  background:var(--card); border:1px solid var(--line); border-radius:14px;
  padding:36px 34px; max-width:360px; width:100%;
  display:flex; flex-direction:column; align-items:center; text-align:center;
  box-shadow:0 8px 30px rgba(0,0,0,.06);
  position:relative; z-index:1;
}
.login-card img{width:52px; height:52px; margin-bottom:12px;}
.login-card h1{font-size:20px;}
.login-card .tag{color:var(--orange-dark); font-size:12px; letter-spacing:.08em; text-transform:uppercase; font-weight:600; margin-bottom:22px;}
.login-card form{width:100%; display:flex; flex-direction:column; gap:14px; text-align:left;}
.login-error{color:var(--warn); font-size:12.5px; min-height:1em;}
.login-note{margin-top:18px; font-size:11.5px; color:var(--muted); line-height:1.5;}

/* ---------- App shell ---------- */
.header{
  display:flex; align-items:center; gap:16px;
  padding:22px 32px;
  background:var(--ink);
  position:relative; z-index:2;
  border-bottom:4px solid var(--orange);
}
.header img{width:44px; height:44px; display:block;}
.header .titles{display:flex; flex-direction:column; gap:2px; flex:1;}
.header h1{color:#fff; font-size:20px;}
.header .tag{color:var(--orange); font-size:12px; letter-spacing:0.08em; text-transform:uppercase; font-weight:600;}
.header .user-area{display:flex; align-items:center; gap:12px;}
.header #user-badge{color:#DAD6CE; font-size:12.5px;}
.header .logout-btn{
  background:transparent; border:1px solid #55554f; color:#DAD6CE;
  border-radius:7px; padding:7px 12px; font-size:12.5px; cursor:pointer; font-family:'Hanken Grotesk';
}
.header .logout-btn:hover{border-color:var(--orange); color:#fff;}

#natluc-root::before{
  content:"";
  position:fixed;
  top:-120px; right:-160px;
  width:520px; height:640px;
  background:
    linear-gradient(135deg, transparent 0 46%, var(--orange) 46% 50%, transparent 50% 100%),
    linear-gradient(45deg, transparent 0 46%, var(--charcoal) 46% 50%, transparent 50% 100%);
  opacity:0.05;
  pointer-events:none;
  z-index:0;
}

.nav{
  display:flex; gap:4px; padding:14px 32px 0 32px;
  position:relative; z-index:2;
  border-bottom:1px solid var(--line);
  background:var(--cream);
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.nav::-webkit-scrollbar{display:none;}
.nav button{
  font-family:'Bricolage Grotesque',sans-serif;
  background:none; border:none; cursor:pointer;
  padding:10px 18px; font-size:14px; font-weight:600;
  color:var(--muted);
  border-bottom:3px solid transparent;
  transition:color .15s, border-color .15s;
  flex:0 0 auto; white-space:nowrap;
}
.nav button:hover{color:var(--ink);}
.nav button.active{color:var(--ink); border-bottom-color:var(--orange);}

.content{padding:28px 32px; position:relative; z-index:1; max-width:1180px; margin:0 auto;}

.cards-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:26px;}
.stat-card{
  background:var(--card); border:1px solid var(--line); border-radius:10px;
  padding:16px 18px; position:relative; overflow:hidden;
}
.stat-card .diamond{
  position:absolute; top:-14px; right:-14px; width:44px; height:44px;
  background:var(--orange); opacity:.12; transform:rotate(45deg);
}
.stat-card .num{font-family:'Bricolage Grotesque',sans-serif; font-size:28px; font-weight:700; color:var(--ink);}
.stat-card .lbl{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-top:2px;}

.panel{
  background:var(--card); border:1px solid var(--line); border-radius:12px;
  padding:22px; margin-bottom:20px;
}
.panel h2{font-size:17px; margin-bottom:14px; display:flex; align-items:center; gap:8px;}
.panel h2::before{content:""; width:9px; height:9px; background:var(--orange); transform:rotate(45deg); display:inline-block;}

.btn{
  font-family:'Hanken Grotesk',sans-serif; font-weight:600; font-size:13px;
  background:var(--orange); color:#fff; border:none; border-radius:7px;
  padding:10px 16px; cursor:pointer; transition:background .15s, transform .1s;
}
.btn:hover{background:var(--orange-dark);}
.btn:active{transform:scale(.98);}
.btn:disabled{opacity:.6; cursor:default;}
.btn.secondary{background:transparent; color:var(--charcoal); border:1px solid var(--line);}
.btn.secondary:hover{border-color:var(--charcoal); background:#F2EFEA;}
.btn.small{padding:6px 11px; font-size:12px;}
.btn.danger{background:transparent; color:var(--warn); border:1px solid #ecccc6;}
.btn.danger:hover{background:#fbebe8;}

form.grid-form{display:grid; grid-template-columns:repeat(2,1fr); gap:14px;}
.field{display:flex; flex-direction:column; gap:5px;}
.field.full{grid-column:1 / -1;}
.field label{font-size:12px; font-weight:600; color:var(--charcoal); text-transform:uppercase; letter-spacing:.04em;}
.field input, .field select, .field textarea{
  font-family:'Hanken Grotesk',sans-serif; font-size:14px;
  padding:9px 11px; border:1px solid var(--line); border-radius:7px;
  background:#fff; color:var(--ink); outline:none;
}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--orange); box-shadow:0 0 0 3px rgba(234,154,33,.15);}
.field textarea{resize:vertical; min-height:60px;}
.form-actions{grid-column:1/-1; display:flex; gap:10px; margin-top:4px;}

.photo-picker{display:flex; flex-direction:column; gap:10px; align-items:flex-start;}
.photo-thumbs{display:flex; flex-wrap:wrap; gap:8px;}
.photo-thumb{position:relative; width:64px; height:64px; border-radius:7px; overflow:hidden; border:1px solid var(--line);}
.photo-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.photo-thumb .photo-remove{
  position:absolute; top:2px; right:2px; width:18px; height:18px; line-height:16px;
  background:rgba(42,42,44,.75); color:#fff; border:none; border-radius:50%;
  font-size:13px; cursor:pointer; padding:0;
}
.photo-history-thumbs{display:flex; flex-wrap:wrap; gap:6px;}
.photo-history-thumbs img{width:40px; height:40px; object-fit:cover; border-radius:6px; border:1px solid var(--line); display:block;}

table{width:100%; border-collapse:collapse; font-size:13.5px;}
th{
  text-align:left; padding:9px 10px; font-size:11px; text-transform:uppercase;
  letter-spacing:.05em; color:var(--muted); border-bottom:2px solid var(--line); white-space:nowrap;
}
td{padding:11px 10px; border-bottom:1px solid var(--line); vertical-align:top;}
tr:hover td{background:#FBF9F5;}

.search-bar{display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap;}
.search-bar input, .search-bar select{
  font-family:'Hanken Grotesk'; padding:9px 12px; border:1px solid var(--line); border-radius:7px; font-size:13.5px;
}
.search-bar input{flex:1; min-width:180px;}

.pill{
  display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:700;
  text-transform:uppercase; letter-spacing:.03em;
}
.pill.physical{background:#FDEBD3; color:var(--orange-dark);}
.pill.email{background:#E2ECE7; color:var(--good);}
.pill.call{background:#E4EAF5; color:#2E4F9C;}
.pill.quote{background:#F3E4ED; color:#9C2E6F;}

.spend-tag{font-size:12px; font-weight:700;}
.spend-tag.high{color:var(--good);}
.spend-tag.medium{color:var(--orange-dark);}
.spend-tag.low{color:var(--muted);}

.empty-state{text-align:center; padding:40px 20px; color:var(--muted);}
.empty-state .diamond-big{
  width:36px; height:36px; background:var(--orange); opacity:.25; transform:rotate(45deg);
  margin:0 auto 14px auto;
}

.cust-card{
  border:1px solid var(--line); border-radius:10px; padding:16px; margin-bottom:12px;
  background:#fff; cursor:pointer; transition:border-color .15s, box-shadow .15s;
}
.cust-card:hover{border-color:var(--orange); box-shadow:0 2px 10px rgba(0,0,0,.05);}
.cust-card-top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px;}
.cust-card-top h3{font-size:16px;}
.cust-card .meta{font-size:12.5px; color:var(--muted); margin-top:3px;}
.cust-card .details-row{display:flex; gap:18px; margin-top:10px; flex-wrap:wrap; font-size:12.5px; color:var(--charcoal);}
.cust-card .details-row b{color:var(--ink);}

.modal-overlay{
  position:fixed; inset:0; background:rgba(20,18,15,.55); display:flex; align-items:center; justify-content:center;
  z-index:50; padding:20px;
}
.modal{
  background:#fff; border-radius:12px; max-width:680px; width:100%; max-height:88vh; overflow-y:auto;
  padding:26px; position:relative;
}
.modal .close-x{
  position:absolute; top:16px; right:18px; background:none; border:none; font-size:20px; cursor:pointer; color:var(--muted);
}
.modal h2{margin-bottom:4px;}
.modal .sub{color:var(--muted); font-size:13px; margin-bottom:18px;}

.cal-wrap{display:flex; justify-content:space-between; align-items:center; margin-bottom:16px;}
.cal-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:6px;}
.cal-dow{text-align:center; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; padding-bottom:4px;}
.cal-day{
  border:1px solid var(--line); border-radius:8px; min-height:78px; padding:6px; font-size:12px;
  cursor:pointer; background:#fff; position:relative; display:flex; flex-direction:column; gap:3px;
}
.cal-day:hover{border-color:var(--orange);}
.cal-day.empty{background:transparent; border:none; cursor:default;}
.cal-day.today{border-color:var(--orange); border-width:2px;}
.cal-day .dnum{font-weight:700; color:var(--ink);}
.cal-day .dot-row{display:flex; flex-wrap:wrap; gap:3px; margin-top:2px;}
.cal-day .dot{width:7px; height:7px; border-radius:50%;}
.dot.physical{background:var(--orange-dark);}
.dot.email{background:var(--good);}
.dot.call{background:#2E4F9C;}
.dot.quote{background:#9C2E6F;}

@media (max-width:640px){
  form.grid-form{grid-template-columns:1fr;}
  .header{padding:16px 18px; flex-wrap:wrap;} .nav{padding:12px 18px 0 18px;} .content{padding:20px 18px;}
  .cal-day{min-height:56px;}
}
