:root{
  --navy:#0A1F3F; --navy-soft:#0D2547; --gold:#D4AF37; --gold-soft:#E8CD7A;
  --white:#FFFFFF; --light-gray:#F8F9FA; --text:#2C3E50; --text-muted:#5C6B7A;
  --border:#E4E8ED; --radius:10px; --green:#1E8E5A; --red:#C0392B; --amber:#B8860B;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{font-family:'Inter',sans-serif; color:var(--text); background:var(--light-gray); line-height:1.55;}
a{color:inherit; text-decoration:none;}
h1,h2,h3{font-family:'Fraunces',serif; font-weight:600; letter-spacing:-0.01em; color:var(--navy);}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 22px; border-radius:8px; font-weight:700; font-size:14px; cursor:pointer; border:1.5px solid transparent; transition:.15s; background:none; font-family:inherit;}
.btn-gold{background:var(--gold); color:var(--navy); box-shadow:0 6px 16px rgba(212,175,55,0.25);}
.btn-gold:hover{background:var(--gold-soft);}
.btn-navy{background:var(--navy); color:#fff;}
.btn-navy:hover{background:var(--navy-soft);}
.btn-ghost{border-color:var(--border); color:var(--navy); background:#fff;}
.btn-ghost:hover{border-color:var(--navy);}
.btn-danger{background:#fdecea; color:var(--red);}
.btn-danger:hover{background:#fbd9d6;}
.btn-sm{padding:8px 14px; font-size:12.5px;}
input,select,textarea{width:100%; border:1px solid var(--border); border-radius:8px; padding:11px 13px; font-family:inherit; font-size:14px; background:#fff;}
label{display:block; font-weight:600; font-size:12.5px; margin-bottom:6px; color:var(--navy);}
.field{margin-bottom:16px;}

/* ===== Auth pages ===== */
.auth-shell{min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(160deg, var(--navy) 0%, #0D2547 45%, #05131F 100%); padding:24px;}
.auth-card{background:#fff; border-radius:16px; padding:42px; width:100%; max-width:400px; box-shadow:0 30px 60px rgba(0,0,0,0.25);}
.auth-logo{display:flex; align-items:center; gap:9px; font-weight:800; font-size:17px; color:var(--navy); margin-bottom:26px; font-family:'Inter',sans-serif;}
.auth-card h1{font-size:23px; margin-bottom:6px;}
.auth-sub{color:var(--text-muted); font-size:13.5px; margin-bottom:24px;}
.auth-switch{text-align:center; font-size:13.5px; color:var(--text-muted); margin-top:18px;}
.auth-switch a{color:var(--gold); font-weight:700;}
.role-picker{display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-bottom:18px;}
.role-opt{border:1.5px solid var(--border); border-radius:8px; padding:10px 6px; text-align:center; font-size:12.5px; font-weight:700; color:var(--text-muted); cursor:pointer;}
.role-opt.active{border-color:var(--gold); background:#FDF8ED; color:var(--navy);}
.msg{font-size:13px; border-radius:8px; padding:10px 12px; margin-bottom:16px; display:none;}
.msg.show{display:block;}
.msg.error{background:#fdecea; color:var(--red);}
.msg.success{background:#eafaf1; color:var(--green);}
.demo-note{font-size:11.5px; color:var(--text-muted); background:var(--light-gray); border-radius:8px; padding:10px 12px; margin-top:16px; line-height:1.5;}

/* ===== App shell (dashboards) ===== */
.app-shell{display:flex; min-height:100vh;}
.sidebar{width:236px; background:var(--navy); color:#fff; flex-shrink:0; display:flex; flex-direction:column; position:sticky; top:0; height:100vh;}
.sidebar-logo{display:flex; align-items:center; gap:9px; font-weight:800; font-size:16px; padding:22px 22px 18px; font-family:'Inter',sans-serif;}
.sidebar-nav{flex-grow:1; padding:6px 12px;}
.sidebar-nav a{display:flex; align-items:center; gap:11px; padding:11px 14px; border-radius:8px; font-size:13.5px; font-weight:600; color:rgba(255,255,255,0.68); margin-bottom:3px;}
.sidebar-nav a:hover{background:rgba(255,255,255,0.06); color:#fff;}
.sidebar-nav a.active{background:rgba(212,175,55,0.14); color:var(--gold-soft);}
.sidebar-foot{padding:16px 20px; border-top:1px solid rgba(255,255,255,0.1);}
.sidebar-foot .role-tag{font-size:11px; color:rgba(255,255,255,0.5); text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px;}
.sidebar-foot button{width:100%; background:rgba(255,255,255,0.08); color:#fff; border:none; border-radius:8px; padding:9px; font-size:12.5px; font-weight:700; cursor:pointer;}
.sidebar-foot button:hover{background:rgba(255,255,255,0.15);}

.main{flex-grow:1; min-width:0;}
.topbar{background:#fff; border-bottom:1px solid var(--border); padding:16px 30px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:20;}
.topbar h2{font-size:19px;}
.topbar-right{display:flex; align-items:center; gap:18px;}
.bell{position:relative; cursor:pointer; font-size:18px;}
.bell .dot{position:absolute; top:-3px; right:-3px; width:9px; height:9px; border-radius:50%; background:var(--red); border:1.5px solid #fff;}
.avatar{width:34px; height:34px; border-radius:50%; background:var(--gold); color:var(--navy); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px;}
.content{padding:28px 30px 60px; max-width:1180px;}

.grid{display:grid; gap:18px;}
.grid-2{grid-template-columns:1fr 1fr;}
.grid-3{grid-template-columns:repeat(3,1fr);}
.grid-4{grid-template-columns:repeat(4,1fr);}
.card{background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:22px;}
.card h3{font-size:15.5px; margin-bottom:14px;}
.stat-card{display:flex; flex-direction:column; gap:6px;}
.stat-card .num{font-family:'Fraunces',serif; font-size:30px; color:var(--navy); font-weight:600;}
.stat-card .label{font-size:12.5px; color:var(--text-muted); font-weight:600;}
.stat-card .trend{font-size:11.5px; color:var(--green); font-weight:700;}

.list-row{display:flex; align-items:center; justify-content:space-between; padding:13px 0; border-bottom:1px solid var(--border);}
.list-row:last-child{border-bottom:none;}
.list-row .who{display:flex; align-items:center; gap:12px;}
.list-row .meta{font-size:12px; color:var(--text-muted);}
.badge{font-size:11px; font-weight:700; padding:4px 10px; border-radius:20px; text-transform:uppercase; letter-spacing:.03em;}
.badge.upcoming{background:#EAF1FF; color:#2A5FBF;}
.badge.completed{background:#EAFAF1; color:var(--green);}
.badge.cancelled{background:#fdecea; color:var(--red);}
.badge.pending{background:#FDF6E3; color:var(--amber);}
.badge.approved{background:#EAFAF1; color:var(--green);}

table{width:100%; border-collapse:collapse; font-size:13.5px;}
th{text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); padding:10px 12px; border-bottom:2px solid var(--border);}
td{padding:12px; border-bottom:1px solid var(--border);}
tr:last-child td{border-bottom:none;}

.progress-track{background:var(--light-gray); border-radius:20px; height:9px; overflow:hidden;}
.progress-fill{background:linear-gradient(90deg, var(--gold), var(--gold-soft)); height:100%; border-radius:20px; transition:width .4s;}

.chat-box{display:flex; flex-direction:column; height:420px; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden;}
.chat-messages{flex-grow:1; padding:16px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; background:var(--light-gray);}
.bubble{max-width:70%; padding:10px 14px; border-radius:14px; font-size:13.5px;}
.bubble.mine{align-self:flex-end; background:var(--navy); color:#fff; border-bottom-right-radius:4px;}
.bubble.theirs{align-self:flex-start; background:#fff; border:1px solid var(--border); border-bottom-left-radius:4px;}
.chat-input{display:flex; gap:8px; padding:12px; border-top:1px solid var(--border); background:#fff;}
.chat-input input{flex-grow:1;}

.notif-panel{position:absolute; top:56px; right:30px; width:320px; background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:0 20px 40px rgba(0,0,0,0.12); z-index:50; display:none;}
.notif-panel.show{display:block;}
.notif-item{padding:13px 16px; border-bottom:1px solid var(--border); font-size:13px;}
.notif-item:last-child{border-bottom:none;}
.notif-item .time{color:var(--text-muted); font-size:11px; margin-top:3px;}

.modal-overlay{position:fixed; inset:0; background:rgba(10,31,63,0.55); display:none; align-items:center; justify-content:center; z-index:200; padding:20px;}
.modal-overlay.show{display:flex;}
.modal-box{background:#fff; border-radius:14px; padding:30px; width:100%; max-width:440px; max-height:88vh; overflow-y:auto;}
.modal-box h3{margin-bottom:16px;}

.tag-chip{display:inline-block; background:var(--light-gray); border:1px solid var(--border); border-radius:20px; padding:4px 12px; font-size:12px; font-weight:600; margin:0 6px 6px 0;}
.empty-state{text-align:center; padding:40px 20px; color:var(--text-muted); font-size:13.5px;}

@media (max-width:900px){
  .sidebar{position:fixed; left:-236px; z-index:100; transition:.2s;}
  .sidebar.open{left:0;}
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr;}
  .content{padding:20px 16px 50px;}
  .topbar{padding:14px 16px;}
}
