:root{
  --bg:#F0FAF4;
  --surface:#FFFFFF;
  --primary:#166534;
  --primary-hover:#14532D;
  --primary-light:#DCFCE7;
  --accent:#4ADE80;
  --accent-light:#BBF7D0;
  --secondary:#2563EB;
  --warning:#F59E0B;
  --danger:#DC2626;
  --success:#16A34A;
  --text:#052E16;
  --text-secondary:#365314;
  --muted:#6B7280;
  --border:#D1FAE5;
  --border-dark:#A7F3D0;
  --shadow:0 12px 30px rgba(22,101,52,.08);
  --hover-shadow:0 18px 40px rgba(22,101,52,.15);
  --radius:18px;
  --transition:.25s ease;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:'Inter',system-ui,sans-serif;
  background:radial-gradient(circle at top left,#DCFCE7 0,#F0FAF4 38%,#F8FFFB 100%);
  color:var(--text);
}

a{
  text-decoration:none;
  color:inherit;
}

.app{
  display:flex;
  min-height:100vh;
}

/* LIGHT GREEN SIDEBAR */

.sidebar{
  width:280px;
  position:fixed;
  inset:0 auto 0 0;
  background:#F0FAF4;
  border-right:1px solid var(--border);
  padding:20px;
  z-index:1000;
  box-shadow:8px 0 35px rgba(22,101,52,.08);
  color:var(--text);
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:22px;
}

.logo{
  width:48px;
  height:48px;
  border-radius:16px;
  background:linear-gradient(135deg,var(--primary),var(--accent));
  color:white;
  display:grid;
  place-items:center;
  font-weight:900;
}

.brand h3{
  margin:0;
  font-size:18px;
  color:var(--primary);
}

.brand p{
  margin:2px 0 0;
  color:var(--muted);
  font-size:12px;
}

.userbox{
  background:white;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  margin-bottom:18px;
  box-shadow:0 6px 18px rgba(22,101,52,.06);
}

.userbox strong{
  display:block;
  color:var(--text);
}

.userbox span{
  color:var(--primary);
  font-size:12px;
  font-weight:800;
}

.nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border-radius:14px;
  margin:5px 0;
  color:var(--text-secondary);
  font-weight:800;
  transition:var(--transition);
}

.nav a i{
  width:34px;
  height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--primary-light);
  color:var(--primary);
  font-size:17px;
}

.nav a:hover{
  background:var(--primary-light);
  color:var(--primary);
  transform:translateX(4px);
}

.nav a:hover i{
  background:var(--primary);
  color:white;
}

.nav a.active{
  background:var(--primary);
  color:white;
  box-shadow:0 8px 22px rgba(22,101,52,.25);
}

.nav a.active i{
  background:white;
  color:var(--primary);
}

.count{
  margin-left:auto;
  background:var(--danger);
  color:white;
  border-radius:999px;
  font-size:11px;
  padding:2px 8px;
}

/* MAIN */

.main{
  margin-left:280px;
  flex:1;
  padding:22px;
}

.topbar{
  height:70px;
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(16px);
  border:1px solid var(--border);
  border-radius:22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  margin-bottom:22px;
  position:sticky;
  top:14px;
  z-index:900;
  box-shadow:var(--shadow);
}

.menu{
  display:none;
  border:0;
  background:var(--primary-light);
  color:var(--primary);
  border-radius:12px;
  padding:9px 12px;
}

.search{
  max-width:340px;
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
  background:#F8FFFB;
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
}

.search input{
  border:0;
  background:transparent;
  outline:0;
  width:100%;
}

.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.icon-btn{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid var(--border);
  background:white;
  display:grid;
  place-items:center;
  color:var(--primary);
  position:relative;
}

.dot{
  position:absolute;
  right:8px;
  top:8px;
  width:9px;
  height:9px;
  border-radius:50%;
  background:var(--danger);
}

/* PAGE */

.page-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:20px;
}

.kicker{
  color:var(--text-secondary);
  font-size:13px;
  font-weight:800;
}

.page-head h1{
  margin:0;
  font-weight:900;
  letter-spacing:-.04em;
}

/* CARDS */

.cardx{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
}

.grid-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(185px,1fr));
  gap:16px;
  margin-bottom:20px;
}

.stat{
  transition:var(--transition);
  display:block;
}

.stat:hover{
  transform:translateY(-4px);
  border-color:var(--border-dark);
  box-shadow:var(--hover-shadow);
}

.stat-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.stat-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  background:var(--primary-light);
  color:var(--primary);
  display:grid;
  place-items:center;
  font-size:22px;
}

.num{
  font-size:34px;
  font-weight:900;
  margin-top:14px;
}

.label{
  color:var(--muted);
  font-size:13px;
}

.hint{
  font-size:12px;
  color:var(--success);
  margin-top:6px;
}

/* FORMS */

.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
}

.form-control,
.form-select{
  border-radius:14px!important;
  border-color:var(--border)!important;
  padding:.75rem!important;
}

.form-control:focus,
.form-select:focus{
  border-color:var(--primary)!important;
  box-shadow:0 0 0 .2rem rgba(22,101,52,.12)!important;
}

/* BUTTONS */

.btn{
  border-radius:14px!important;
  font-weight:800!important;
  padding:.7rem 1rem!important;
}

.btn-primary{
  background:var(--primary)!important;
  border-color:var(--primary)!important;
}

.btn-primary:hover{
  background:var(--primary-hover)!important;
  border-color:var(--primary-hover)!important;
}

.btn-success{
  background:var(--success)!important;
}

.btn-danger{
  background:var(--danger)!important;
}

.btn-soft{
  background:var(--primary-light)!important;
  color:var(--primary)!important;
  border:1px solid var(--border-dark)!important;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.quick{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

.chip{
  padding:7px 11px;
  background:#F8FFFB;
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--primary);
  font-size:12px;
  font-weight:800;
}

/* TABLE */

.table-card{
  padding:0;
  overflow:hidden;
}

.table-title{
  padding:16px 18px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.table-wrap{
  overflow:auto;
}

.table{
  margin:0!important;
  min-width:950px;
}

.table th{
  background:#ECFDF5!important;
  color:#14532D!important;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.table td,
.table th{
  padding:14px!important;
  border-color:var(--border)!important;
}

.table tr:hover{
  background:#F0FDF4;
}

/* BADGES */

.badge-soft{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.b-not-started{
  background:#F3F4F6;
  color:#374151;
}

.b-ongoing{
  background:#DBEAFE;
  color:#1D4ED8;
}

.b-hold{
  background:#FEF3C7;
  color:#92400E;
}

.b-approved,
.b-completed{
  background:#DCFCE7;
  color:#166534;
}

.b-waiting-approval,
.b-waiting-for-approval{
  background:#F3E8FF;
  color:#7E22CE;
}

.b-rejected,
.b-cancelled,
.b-urgent{
  background:#FEE2E2;
  color:#B91C1C;
}

.b-high{
  background:#FFEDD5;
  color:#C2410C;
}

.b-medium{
  background:#DBEAFE;
  color:#1D4ED8;
}

.b-low{
  background:#F3F4F6;
  color:#374151;
}

.row-overdue{
  background:#FEF2F2!important;
}

.row-today{
  background:#FFFBEB!important;
}

/* PROGRESS */

.progress-thin{
  height:9px;
  background:#E5E7EB;
  border-radius:999px;
  overflow:hidden;
}

.progress-thin span{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--primary),var(--accent));
}

/* LOGIN */

.login-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  background:radial-gradient(circle at 20% 10%,#BBF7D0 0,#F0FAF4 35%,#FFFFFF 100%);
  padding:24px;
}

.login-card{
  width:430px;
  max-width:100%;
  background:white;
  border:1px solid var(--border);
  box-shadow:var(--hover-shadow);
  border-radius:28px;
  padding:30px;
}

.login-logo{
  width:70px;
  height:70px;
  border-radius:22px;
  background:linear-gradient(135deg,var(--primary),var(--accent));
  color:white;
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:22px;
  margin-bottom:18px;
}

.pass-wrap{
  position:relative;
}

.show-pass{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  cursor:pointer;
  color:var(--muted);
}

/* TIMELINE */

.timeline{
  border-left:2px solid var(--border);
  padding-left:16px;
}

.tl{
  position:relative;
  margin-bottom:14px;
}

.tl:before{
  content:"";
  position:absolute;
  left:-22px;
  top:5px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--primary);
}

/* PRIORITY PANEL */

.priority-panel{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
}

.priority-item{
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#F8FFFB;
}

/* RESPONSIVE */

@media(max-width:900px){
  .sidebar{
    transform:translateX(-105%);
    transition:.2s;
  }

  .open .sidebar{
    transform:translateX(0);
  }

  .main{
    margin-left:0;
    padding:14px;
  }

  .menu{
    display:block;
  }

  .search{
    display:none;
  }

  .topbar{
    top:0;
    border-radius:0;
    margin:-14px -14px 18px;
  }

  .page-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .grid-cards{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:560px){
  .grid-cards{
    grid-template-columns:1fr;
  }

  .actions .btn{
    width:100%;
  }

  .login-card{
    padding:24px;
  }
}

.badge-urgent-blink{
    background:linear-gradient(135deg,#dc2626,#f97316,#dc2626);
    color:#fff !important;
    border:1px solid #fecaca;
    box-shadow:0 0 0 rgba(220,38,38,.7);
    animation:urgentBlink 1.1s infinite;
    font-weight:900;
    letter-spacing:.6px;
}

@keyframes urgentBlink{
    0%{
        transform:scale(1);
        box-shadow:0 0 0 0 rgba(220,38,38,.7);
        opacity:1;
    }
    50%{
        transform:scale(1.08);
        box-shadow:0 0 18px 4px rgba(249,115,22,.55);
        opacity:.75;
    }
    100%{
        transform:scale(1);
        box-shadow:0 0 0 0 rgba(220,38,38,.7);
        opacity:1;
    }
}