:root{
  --navy:#0A1F44;
  --navy-light:#132A54;
  --navy-lighter:#1E3A66;
  --gold:#D4A017;
  --gold-soft:#F2D98A;
  --teal:#2A9D8F;
  --bg:#F5F6F8;
  --card:#FFFFFF;
  --border:#E2E5EA;
  --text:#1B2430;
  --text-muted:#6B7280;
  --danger:#C0392B;
  --danger-bg:#FDECEA;
  --success:#1E7E4F;
  --success-bg:#E7F6EE;
  --radius:8px;
  --shadow:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  line-height:1.5;
}
a{color:var(--navy-lighter); text-decoration:none;}
a:hover{text-decoration:underline;}
h1,h2,h3,h4{margin:0 0 8px; font-weight:700; color:var(--navy);}
h1{font-size:22px;} h2{font-size:18px;} h3{font-size:15px;}
p{margin:0 0 12px;}
.muted{color:var(--text-muted);}

/* ---- Auth pages (bare layout) -------------------------------------------- */
.auth-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(160deg, var(--navy) 0%, var(--navy-lighter) 55%, var(--navy) 100%);
  padding:24px;
}
.auth-card{
  background:var(--card); border-radius:12px; box-shadow:0 20px 60px rgba(0,0,0,.35);
  width:100%; max-width:400px; padding:36px 32px;
}
.auth-logo{display:flex; align-items:center; gap:10px; margin-bottom:24px;}
.auth-logo .mark{
  width:38px; height:38px; border-radius:8px; background:var(--navy);
  color:var(--gold); font-weight:800; display:flex; align-items:center; justify-content:center; font-size:18px;
}
.auth-logo .name{font-size:19px; font-weight:800; color:var(--navy);}
.auth-sub{color:var(--text-muted); margin-bottom:24px; font-size:13px;}

/* ---- Forms --------------------------------------------------------------- */
label{display:block; font-weight:600; font-size:13px; margin-bottom:5px; color:var(--navy);}
input[type=text],input[type=email],input[type=password],input[type=date],input[type=time],
input[type=number],input[type=tel],select,textarea{
  width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:6px;
  font-size:14px; background:#fff; color:var(--text); font-family:inherit;
}
input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--navy-lighter); box-shadow:0 0 0 3px rgba(19,42,84,.12);
}
.form-group{margin-bottom:16px;}
.form-row{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
.form-row-3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px;}
.checkbox-row{display:flex; align-items:center; gap:8px;}
.checkbox-row input{width:auto;}
fieldset{border:1px solid var(--border); border-radius:8px; padding:16px; margin-bottom:20px;}
legend{font-weight:700; color:var(--navy); padding:0 6px; font-size:13px;}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:9px 18px; border-radius:6px; font-weight:600; font-size:13px;
  border:1px solid transparent; cursor:pointer; text-decoration:none;
}
.btn:hover{text-decoration:none;}
.btn-primary{background:var(--navy); color:#fff;}
.btn-primary:hover{background:var(--navy-lighter);}
.btn-gold{background:var(--gold); color:var(--navy);}
.btn-gold:hover{background:#c2910f;}
.btn-outline{background:#fff; border-color:var(--border); color:var(--navy);}
.btn-outline:hover{border-color:var(--navy-lighter); background:#fafbfc;}
.btn-danger{background:var(--danger); color:#fff;}
.btn-sm{padding:5px 11px; font-size:12px;}
.btn-block{width:100%;}

/* ---- Layout ---------------------------------------------------------------- */
.shell{display:flex; min-height:100vh;}
.sidebar{
  width:220px; background:var(--navy); color:#fff; flex-shrink:0;
  display:flex; flex-direction:column; padding:20px 0;
}
.brand{display:flex; align-items:center; gap:10px; padding:0 20px 20px; border-bottom:1px solid rgba(255,255,255,.1); margin-bottom:12px;}
.brand-mark{width:32px; height:32px; border-radius:7px; background:var(--gold); color:var(--navy); font-weight:800; display:flex; align-items:center; justify-content:center;}
.brand-name{font-weight:800; font-size:16px; letter-spacing:.3px;}
.nav{display:flex; flex-direction:column; gap:2px; padding:0 12px;}
.nav-link{color:rgba(255,255,255,.75); padding:9px 12px; border-radius:6px; font-size:13.5px; font-weight:500;}
.nav-link:hover{background:rgba(255,255,255,.08); color:#fff; text-decoration:none;}
.nav-section{color:rgba(255,255,255,.4); font-size:11px; text-transform:uppercase; letter-spacing:.6px; padding:16px 12px 6px;}

.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  background:#fff; border-bottom:1px solid var(--border); padding:14px 28px;
  display:flex; align-items:center; justify-content:space-between;
}
.topbar-title{font-weight:700; color:var(--navy); font-size:15px; display:flex; align-items:center; gap:10px;}
.company-switcher{display:inline-block;}
.company-switcher select{padding:5px 10px; border-radius:20px; border:1px solid var(--border); background:var(--gold-soft); color:var(--navy); font-weight:700; font-size:12px; cursor:pointer; width:auto;}
.topbar-user{display:flex; align-items:center; gap:14px;}
.user-avatar{width:30px; height:30px; border-radius:50%; background:var(--gold-soft); color:var(--navy); font-weight:700; font-size:12px; display:flex; align-items:center; justify-content:center;}
.user-name{font-weight:600; font-size:13px;}
.topbar-link{color:var(--text-muted); font-size:13px;}
.notification-bell{position:relative; font-size:16px; text-decoration:none !important;}
.notification-badge{position:absolute; top:-6px; right:-8px; background:var(--danger); color:#fff; font-size:10px; font-weight:800; border-radius:10px; padding:1px 5px; min-width:16px; text-align:center;}

.content{padding:28px; max-width:1200px; width:100%; margin:0 auto;}

/* ---- Alerts --------------------------------------------------------------- */
.alert{padding:11px 16px; border-radius:6px; margin-bottom:16px; font-size:13.5px; font-weight:500;}
.alert-success{background:var(--success-bg); color:var(--success); border:1px solid #bfe6cf;}
.alert-error{background:var(--danger-bg); color:var(--danger); border:1px solid #f3c7c1;}

/* ---- Cards / stats --------------------------------------------------------- */
.card{background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); margin-bottom:20px;}
.card-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.stat-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:16px; margin-bottom:24px;}
.stat-card{background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; box-shadow:var(--shadow);}
.stat-value{font-size:26px; font-weight:800; color:var(--navy);}
.stat-label{color:var(--text-muted); font-size:12.5px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; margin-top:4px;}
.stat-accent{border-left:4px solid var(--gold);}

/* ---- Tables ---------------------------------------------------------------- */
table{width:100%; border-collapse:collapse; font-size:13.5px;}
th{text-align:left; padding:10px 12px; background:#F8F9FB; color:var(--navy); font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:.3px; border-bottom:2px solid var(--border);}
td{padding:11px 12px; border-bottom:1px solid var(--border); vertical-align:middle;}
tr:last-child td{border-bottom:none;}
.table-wrap{overflow-x:auto;}

/* ---- Badges ------------------------------------------------------------------ */
.badge{display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.3px;}
.badge-active,.badge-approved,.badge-present{background:var(--success-bg); color:var(--success);}
.badge-pending,.badge-late{background:#FFF4DE; color:#9A6B00;}
.badge-terminated,.badge-rejected,.badge-absent{background:var(--danger-bg); color:var(--danger);}
.badge-onleave{background:#EAE6FB; color:#5B3FBF;}
.badge-neutral{background:#EEF0F3; color:var(--text-muted);}

/* ---- Avatars ------------------------------------------------------------------ */
.avatar{width:36px; height:36px; border-radius:50%; object-fit:cover; background:#EEF0F3; display:inline-block; vertical-align:middle;}
.avatar-placeholder{width:36px; height:36px; border-radius:50%; background:var(--navy-lighter); color:#fff; font-weight:700; font-size:12px; display:inline-flex; align-items:center; justify-content:center;}
.emp-photo-lg{width:110px; height:110px; border-radius:12px; object-fit:cover; border:3px solid var(--gold-soft); background:#EEF0F3;}

/* ---- Misc ---------------------------------------------------------------------- */
.flex{display:flex;} .items-center{align-items:center;} .justify-between{justify-content:space-between;}
.gap-8{gap:8px;} .gap-12{gap:12px;} .gap-16{gap:16px;}
.mt-0{margin-top:0;} .mt-16{margin-top:16px;} .mb-0{margin-bottom:0;}
.text-right{text-align:right;} .text-center{text-align:center;}
.pill-tabs{display:flex; gap:6px; margin-bottom:20px; flex-wrap:wrap;}
.pill-tab{padding:7px 14px; border-radius:20px; font-size:12.5px; font-weight:600; background:#EEF0F3; color:var(--text-muted);}
.pill-tab.active{background:var(--navy); color:#fff;}
.empty-state{text-align:center; padding:48px 20px; color:var(--text-muted);}
.empty-state h3{color:var(--text-muted);}
.search-bar{display:flex; gap:10px; margin-bottom:20px; flex-wrap:wrap;}
.search-bar input,.search-bar select{width:auto; min-width:180px;}
.progress-bar{height:8px; border-radius:4px; background:#EEF0F3; overflow:hidden;}
.progress-bar-fill{height:100%; background:var(--gold);}
.doc-list{list-style:none; margin:0; padding:0;}
.doc-list li{display:flex; align-items:center; justify-content:space-between; padding:10px 0; border-bottom:1px solid var(--border);}
.doc-list li:last-child{border-bottom:none;}

.nav-toggle{display:none;}

@media (max-width: 860px){
  .shell{flex-direction:column;}

  .nav-toggle{
    display:flex; align-items:center; justify-content:space-between;
    background:var(--navy); color:#fff; padding:14px 16px; cursor:pointer;
    font-weight:700; font-size:14px; border:none; width:100%;
  }
  .nav-toggle .chevron{transition:transform .2s;}
  .nav-toggle.open .chevron{transform:rotate(180deg);}

  .sidebar{width:100%; padding:0;}
  .sidebar .brand{display:none;}
  .nav{
    flex-direction:column; max-height:0; overflow:hidden; padding:0 12px;
    transition:max-height .25s ease, padding .25s ease;
  }
  .nav.nav-open{max-height:2000px; padding:12px;}
  .nav-link{min-height:44px; display:flex; align-items:center; padding:11px 14px; font-size:14.5px;}

  .content{padding:14px;}
  .form-row,.form-row-3{grid-template-columns:1fr;}

  /* Bigger, easier-to-tap controls on mobile — clock in/out, submit buttons, etc. */
  .btn{min-height:44px; padding:11px 20px; font-size:14px;}
  input,select,textarea{min-height:44px; font-size:15px;}
  textarea{min-height:88px;}
  .checkbox-row input{min-height:auto; width:20px; height:20px;}

  /* Primary action buttons (clock in/out, submit) go full-width for easy thumb reach. */
  .card > form > .btn-primary:only-of-type,
  .card .flex.items-center.justify-between form .btn{width:100%;}

  .topbar{padding:10px 14px; flex-wrap:wrap; gap:8px;}
  .topbar-title{flex-wrap:wrap; font-size:13px;}
  .company-switcher select{min-height:36px; font-size:12px;}
  .topbar-user{gap:10px;}
  .user-name{display:none;} /* avatar + initials is enough on narrow screens */

  .stat-grid{grid-template-columns:repeat(2, 1fr); gap:10px;}
  .stat-value{font-size:22px;}

  /* Tables stay horizontally scrollable rather than reflowing, so data columns
     never get silently cut off on a phone. */
  .table-wrap{-webkit-overflow-scrolling:touch;}
  table{font-size:12.5px;}
  th,td{padding:9px 8px;}
}
