:root{
  --green:#087f72;
  --green-dark:#075c53;
  --orange:#f26422;
  --cream:#fbf6ec;
  --border:#e7e4dc;
  --text:#20231f;
  --muted:#6e756f;
  --danger:#c73a3a;
  --success:#15805f;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:"Cairo",sans-serif;
  background:#faf9f6;
  color:var(--text);
}

a{
  color:inherit;
}

.sidebar{
  position:fixed;
  right:0;
  top:0;
  bottom:0;
  width:260px;
  background:var(--green-dark);
  color:#fff;
  display:flex;
  flex-direction:column;
  z-index:30;
}

.brand{
  padding:24px 18px;
  border-bottom:1px solid rgba(255,255,255,.12);
  display:grid;
  grid-template-columns:58px 1fr;
  column-gap:12px;
  align-items:center;
}

.brand img{
  width:58px;
  height:58px;
  border-radius:12px;
  object-fit:contain;
  background:#fff;
}

.brand strong{
  font-size:18px;
}

.brand small{
  grid-column:2;
  opacity:.7;
}

.sidebar nav{
  padding:16px 10px;
  display:grid;
  gap:5px;
}

.sidebar nav a{
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:10px;
}

.sidebar nav a:hover{
  background:rgba(255,255,255,.1);
}

.user-box{
  margin-top:auto;
  padding:18px;
  border-top:1px solid rgba(255,255,255,.12);
  display:grid;
}

.user-box small{
  opacity:.7;
}

.logout{
  width:100%;
  margin-top:12px;
  border:1px solid rgba(255,255,255,.2);
  background:transparent;
  color:#fff;
  padding:9px;
  border-radius:8px;
  cursor:pointer;
}

.main{
  margin-right:260px;
  min-height:100vh;
}

header{
  height:74px;
  background:#fff;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  position:sticky;
  top:0;
  z-index:20;
}

header h1{
  font-size:23px;
  margin:0;
}

.header-user{
  font-size:13px;
  color:var(--muted);
}

.content{
  padding:26px;
}

.kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:20px;
}

.kpi{
  background:#fff;
  border:1px solid var(--border);
  border-radius:15px;
  padding:20px;
  display:flex;
  gap:14px;
  align-items:center;
}

.kpi > span{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  background:#ddf5eb;
  color:var(--green);
  border-radius:12px;
}

.kpi div{
  display:grid;
}

.kpi small{
  color:var(--muted);
}

.kpi strong{
  font-size:26px;
}

.kpi.money{
  grid-column:span 2;
}

.kpi.money > span{
  background:#fff2d3;
  color:#af7c18;
}

.danger-kpi > span{
  background:#fee8e8;
  color:var(--danger);
}

.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:22px;
  margin-bottom:20px;
}

.card h2{
  margin:0 0 8px;
}

.card p{
  color:var(--muted);
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:15px;
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

form label{
  display:block;
  margin:13px 0 6px;
  font-size:13px;
  font-weight:700;
}

input,
select,
textarea{
  width:100%;
  border:1px solid #dcded9;
  background:#fff;
  padding:11px 12px;
  border-radius:9px;
  font:inherit;
}

input:focus,
select:focus,
textarea:focus{
  outline:2px solid rgba(8,127,114,.15);
  border-color:var(--green);
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px 14px;
}

.form-grid button{
  margin-top:15px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:42px;
  padding:8px 16px;
  background:#fff;
  color:var(--green-dark);
  border:1px solid #d9ddd8;
  border-radius:9px;
  text-decoration:none;
  cursor:pointer;
  font:inherit;
  font-weight:700;
}

.btn.primary{
  background:var(--green);
  color:#fff;
  border-color:var(--green);
}

.success-btn{
  background:#e3f6ed;
  color:#087050;
}

.danger-btn{
  background:#feecec;
  color:#b42626;
}

.table-scroll{
  width:100%;
  overflow-x:auto;
}

table{
  width:100%;
  min-width:780px;
  border-collapse:collapse;
}

th,
td{
  padding:13px;
  text-align:right;
  border-bottom:1px solid #eee;
  white-space:nowrap;
}

th{
  background:#fafaf8;
  font-size:12px;
  color:#626762;
}

.red{
  color:var(--danger);
  font-weight:700;
}

.green{
  color:var(--success);
  font-weight:700;
}

.inline-form{
  display:flex;
  gap:7px;
  min-width:180px;
}

.inline-form input{
  height:38px;
  padding:5px 8px;
}

.small-btn{
  border:0;
  border-radius:7px;
  background:var(--green);
  color:#fff;
  padding:0 12px;
}

.request-lines{
  display:grid;
  gap:9px;
}

.request-line{
  display:grid;
  grid-template-columns:1fr 150px;
  gap:8px;
}

.requests{
  display:grid;
  gap:12px;
}

.request-card{
  border:1px solid var(--border);
  border-radius:13px;
  padding:17px;
}

.request-top{
  display:flex;
  justify-content:space-between;
  gap:15px;
}

.request-top div{
  display:grid;
}

.request-top small{
  color:var(--muted);
}

.request-items{
  margin:15px 0;
  padding:12px;
  background:#f8faf7;
  border-radius:8px;
}

.badge{
  height:max-content;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
}

.badge.warning{
  background:#fff1ca;
  color:#946600;
}

.badge.success{
  background:#ddf7e9;
  color:#0a704c;
}

.badge.danger{
  background:#fee5e5;
  color:#ad2929;
}

.actions{
  display:flex;
  gap:8px;
  margin-top:15px;
}

.empty{
  text-align:center;
  padding:40px;
  color:var(--muted);
}

.alert{
  margin-top:14px;
  border-radius:8px;
  padding:10px;
}

.alert.danger{
  background:#fee5e5;
  color:#9d2525;
}

.login-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at top left,#e8fbf1,transparent 40%),
    var(--cream);
  padding:20px;
}

.login-card{
  width:min(430px,100%);
  background:#fff;
  border:1px solid var(--border);
  border-radius:20px;
  padding:32px;
  box-shadow:0 20px 50px rgba(0,0,0,.06);
}

.login-logo{
  display:block;
  width:220px;
  max-width:100%;
  height:100px;
  object-fit:contain;
  margin:0 auto 15px;
}

.login-card h1{
  text-align:center;
  margin:0;
  color:var(--green-dark);
}

.login-card > p{
  text-align:center;
  color:var(--muted);
}

.login-card .btn{
  width:100%;
  margin-top:18px;
}

@media(max-width:900px){
  .sidebar{
    width:82px;
  }

  .brand{
    display:flex;
    padding:15px 10px;
    justify-content:center;
  }

  .brand img{
    width:48px;
    height:48px;
  }

  .brand strong,
  .brand small,
  .sidebar nav a span:last-child,
  .user-box strong,
  .user-box small{
    display:none;
  }

  .sidebar nav a{
    justify-content:center;
  }

  .main{
    margin-right:82px;
  }

  .kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:600px){
  .sidebar{
    width:64px;
  }

  .main{
    margin-right:64px;
  }

  header{
    padding:0 14px;
    height:62px;
  }

  header h1{
    font-size:18px;
  }

  .header-user{
    display:none;
  }

  .content{
    padding:14px;
  }

  .kpis,
  .grid-2{
    grid-template-columns:1fr;
  }

  .kpi.money{
    grid-column:auto;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .request-line{
    grid-template-columns:1fr 100px;
  }

  .card{
    padding:15px;
    border-radius:12px;
  }
}
