:root{
  --bg:#f4f6f8;
  --card:#ffffff;
  --text:#1b1f24;
  --muted:#6b7280;
  --line:#e5e7eb;
  --blue:#1f6fb2;

  --late:#d9534f;
  --due:#f0ad4e;
  --ontime:#2b7bbb;
  --submitted:#1f6fb2;
  --rejected:#d9534f;
  --completed:#5cb85c;
  --decision:#8b5cf6;

}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color:var(--text);
  background:var(--bg);
}


.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  border:0;
}

/* Top App Bar */
.appbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  background:#fff;
  border-bottom:1px solid var(--line);
}

.iconbtn{
  border:0;
  background:transparent;
  font-size:20px;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
}
.iconbtn:active{ transform:scale(0.98); }

.ghostbtn{
  border:1px solid var(--line);
  background:#fff;
  padding:8px 12px;
  border-radius:12px;
  cursor:pointer;
}

.appbar-title{
  flex:1;
  min-width:0;
}
.appbar-line1{
  font-weight:700;
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.appbar-line2{
  font-size:12px;
  color:var(--muted);
}

.appbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

/* Layout */
.container{
  max-width: 980px;
  margin: 0 auto;
  padding: 12px;
}

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  margin: 10px 0 12px;
}
.tab{
  flex:0 0 auto;
  border:1px solid var(--line);
  background:#fff;
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:700;
  color:#3b3f45;
}
.tab.active{
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(31,111,178,0.12);
}

/* Filters */
.filters{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
}
.filters-title{
  font-weight:700;
  margin-bottom:8px;
}
.chiprow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f9fafb;
  cursor:pointer;
  font-weight:700;
  font-size:13px;
}
.chip-x{ color:var(--muted); }
.chip-link{
  background:transparent;
  border:0;
  color:var(--blue);
  padding-left:0;
}

.filter-controls{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.select{
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:10px 12px;
  min-width: 180px;
}

/* Groups and cards */
.content{ margin-top: 12px; }

.group{
  margin: 14px 0;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}

.group-hd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  font-weight:800;
  color:#fff;
}
.group-hd small{
  font-weight:700;
  opacity:0.9;
}

.hd-LATE{ background: var(--late); }
.hd-DUE_SOON{ background: var(--due); }
.hd-ON_TIME{ background: var(--ontime); }
.hd-SUBMITTED{ background: var(--submitted); }
.hd-REJECTED{ background: var(--rejected); }
.hd-COMPLETED{ background: var(--completed); }
.hd-DECISIONS{ background: var(--decision); }
.bar-DECISIONS{ border-left-color: var(--decision); }


.cards{
  padding:10px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-left:6px solid #999;
  border-radius:14px;
  padding:10px;
  cursor:pointer;
  min-height: 88px;
}
.card h4{
  margin:0 0 6px 0;
  font-size:13px;
}

.card:hover{
  box-shadow: 0 6px 16px rgba(17,24,39,0.08);
  transform: translateY(-1px);
}


.meta{
  font-size:12px;
  color:#4b5563;
  line-height:1.3;
}

.pill{
  display:inline-block;
  margin-top:6px;
  padding:3px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:11px;
  color:#374151;
  background:#f9fafb;
}

.bar-LATE{ border-left-color: var(--late); }
.bar-DUE_SOON{ border-left-color: var(--due); }
.bar-ON_TIME{ border-left-color: var(--ontime); }
.bar-SUBMITTED{ border-left-color: var(--submitted); }
.bar-REJECTED{ border-left-color: var(--rejected); }
.bar-COMPLETED{ border-left-color: var(--completed); }

.footer{
  margin-top: 18px;
  padding: 14px 12px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

/* Mobile responsiveness */
@media (max-width: 860px){
  .cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .cards{ grid-template-columns: 1fr; }
  .select{ width:100%; min-width:0; }
  .ghostbtn{ padding:8px 10px; }
}


/* Panels for task page */
.panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  margin-top:12px;
}

.panel-hd{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.h2{
  margin:0;
  font-size:18px;
}

.btnrow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.btn{
  border:1px solid var(--line);
  background:#fff;
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
}

.btn.primary{
  background: var(--blue);
  border-color: var(--blue);
  color:#fff;
}

.msg{
  margin-top:12px;
  color: var(--muted);
  font-size:13px;
}

/* Rejection styling */
.rejection{
  margin-top:10px;
  border:1px solid var(--late);
  background:#fbeaea;
  border-radius:14px;
  padding:10px;
}

.rejection-title{
  font-weight:900;
  margin-bottom:6px;
}

.rejection-text{
  color:#3b1f1f;
  font-size:13px;
  line-height:1.35;
}

/* Approved styling */
.approved{
  margin-top:10px;
  border:1px solid #22c55e;          /* green */
  background:#dcfce7;                /* light green */
  border-radius:14px;
  padding:10px;
}

.approved-title{
  font-weight:900;
  margin-bottom:6px;
  color:#166534;                     /* dark green */
}

.approved-text{
  color:#14532d;
  font-size:13px;
  line-height:1.35;
}


/* Make task form fields match app */
textarea, input{
  width:100% !important;
  max-width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
  outline:none;
}

textarea:focus, input:focus, select:focus{
  box-shadow: 0 0 0 2px rgba(31,111,178,0.12);
  border-color: var(--blue);
}

label b{
  display:inline-block;
  margin: 8px 0 6px;
}

/* Review area spacing */
#reviewArea{
  margin-top:12px;
}

/* ---------- Decision Needed box (Task page) ---------- */
.decision-box{
  margin-top:12px;
  border:1px solid rgba(139,92,246,0.35);
  background:#fbfaff;
  border-radius:16px;
  padding:12px;
  box-shadow: 0 10px 24px rgba(17,24,39,0.06);
}

.decision-hd{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(139,92,246,0.18);
  margin-bottom:10px;
}

.decision-title{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.decision-icon{
  width:28px;
  height:28px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  background: rgba(139,92,246,0.14);
  color: var(--decision);
  border:1px solid rgba(139,92,246,0.25);
}

.decision-name{
  font-weight:900;
  font-size:14px;
  line-height:1.2;
}

.decision-sub{
  font-size:12px;
  color: var(--muted);
  margin-top:3px;
  line-height:1.35;
}

.decision-pill{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid rgba(139,92,246,0.28);
  background: rgba(139,92,246,0.10);
  color: #4c1d95;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.decision-toggle{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
}

.decision-toggle input{
  width:auto !important;
  margin-top:3px;
}

.decision-toggle-title{
  font-weight:900;
  font-size:13px;
}

.decision-toggle-sub{
  font-size:12px;
  color: var(--muted);
  margin-top:2px;
  line-height:1.35;
}

.decision-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}

.decision-field label b{
  margin: 0 0 6px;
}

.decision-help{
  margin-top:6px;
  font-size:12px;
  color: var(--muted);
}

/* Mobile: stack the decision grid */
@media (max-width: 860px){
  .decision-grid{ grid-template-columns: 1fr; }
}



/* ---------- Auth (Login) page ---------- */
.authbody{
  background: linear-gradient(180deg, #f4f6f8 0%, #eef2f6 100%);
  min-height:100vh;
}

.authwrap{
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 14px;
  display:flex;
  align-items:center;
  min-height:100vh;
}

.authcard{
  width:100%;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow: 0 12px 30px rgba(17,24,39,0.08);
}

.authbrand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}

.authlogo{
  width:44px;
  height:44px;
  border-radius:12px;
  object-fit:contain;
  border:1px solid var(--line);
  background:#fff;
}

.authbrandtitle{
  font-weight:900;
  font-size:16px;
  line-height:1.1;
}

.authbrandsub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}

.authh1{
  margin: 6px 0 6px;
  font-size:20px;
}

.authp{
  margin: 0 0 14px;
  color: var(--muted);
  font-size:13px;
  line-height:1.35;
}

.authform label b{
  display:inline-block;
  margin: 10px 0 6px;
}

.authform input{
  width:100% !important;
  border:1px solid var(--line);
  border-radius:12px;
  padding:11px 12px;
  font-size:14px;
}

.authbtn{
  width:100%;
  margin-top:14px;
  padding:12px 14px;
  border-radius:14px;
}

.authfoot{
  margin-top:12px;
  color: var(--muted);
  font-size:12px;
  line-height:1.35;
}

/* Dropdown menu under ☰ */
.menu{
  position:absolute;
  top:56px;
  left:12px;
  width: 270px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: 0 18px 40px rgba(17,24,39,0.12);
  padding:10px;
}

.menu-hd{
  font-weight:900;
  font-size:13px;
  color:var(--muted);
  padding:4px 8px 8px;
}

.menu-item{
  width:100%;
  text-align:left;
  border:1px solid var(--line);
  background:#fff;
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
  margin-top:8px;
}
.menu-item:active{ transform:scale(0.99); }


.appbar{ position:sticky; }


.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;

  background: #f1f3f5;      /* subtle light grey */
  color: #333;              /* readable dark text */
  border: 1px solid #d0d5dd;

  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  margin-left: 8px;
}

.group-hd.neutral{
  background:#fff;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

/* Notification badge (red, urgent) */
.badge.notif {
  background: #dc2626;        /* red-600 */
  color: #ffffff;
  border-color: #dc2626;

  font-weight: 800;
  font-size: 12px;

  min-width: 20px;
  height: 20px;
  padding: 0 6px;
}

/* Message states */
.msg {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* Success */
.msg.success {
  color: #166534;             /* green-800 */
  background: #dcfce7;        /* green-100 */
  border: 1px solid #86efac;  /* green-300 */
  padding: 10px 12px;
  border-radius: 12px;
}

/* Error */
.msg.error {
  color: #7f1d1d;             /* red-900 */
  background: #fee2e2;        /* red-100 */
  border: 1px solid #fca5a5;  /* red-300 */
  padding: 10px 12px;
  border-radius: 12px;
}

/* ---------------- Accounting: mobile responsiveness ---------------- */

/* Tabs: allow horizontal scroll instead of wrapping into 2-3 rows */
.tabs{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  gap: 8px;
  padding-bottom: 6px;
}

.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 999px; }

.tab{
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Accounting KPI cards: 3 → 2 → 1 columns */
.cards.cards-kpi{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px){
  .cards.cards-kpi{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px){
  .cards.cards-kpi{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px){
  .panel{ padding: 10px; }
  .card{ min-height: 0; }
}
