*{box-sizing:border-box}
:root{
  --bg:#050816;
  --bg2:#0f172a;
  --card:rgba(15,23,42,.82);
  --card-solid:#111827;
  --border:rgba(148,163,184,.18);
  --text:#f8fafc;
  --muted:#94a3b8;
  --green:#22c55e;
  --red:#ef4444;
  --blue:#3b82f6;
  --amber:#f59e0b;
  --purple:#8b5cf6;
  --cyan:#06b6d4;
  --shadow:0 18px 45px rgba(0,0,0,.28);
}
*{-webkit-tap-highlight-color:transparent}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.18), transparent 35%),
    radial-gradient(circle at top left, rgba(139,92,246,.13), transparent 32%),
    linear-gradient(180deg,#020617,#0f172a 45%,#020617);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Tahoma,Arial,sans-serif;
  padding:14px;
  min-height:100vh;
}
.hidden{display:none!important}
.app{max-width:960px;margin:auto;padding-bottom:28px}
.top,.summary,.dashboard,.card,.modal-box,.login-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:28px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center;
  padding:20px;
  margin-bottom:14px;
  position:sticky;
  top:10px;
  z-index:4;
}
h1{margin:0;font-size:28px;letter-spacing:.2px}
.top p{margin:5px 0 4px;color:var(--muted)}
small{color:var(--muted)}
.brand-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:rgba(59,130,246,.13);
  color:#bfdbfe;
  border:1px solid rgba(96,165,250,.22);
  border-radius:999px;
  padding:5px 10px;
  font-size:12px;
  margin-top:4px;
}
.date-card{
  background:linear-gradient(160deg,rgba(2,6,23,.9),rgba(30,41,59,.8));
  border:1px solid var(--border);
  border-radius:20px;
  padding:12px 14px;
  min-width:138px;
  text-align:left;
}
.date-card span{display:block;color:var(--muted);font-size:13px;margin-bottom:4px}
.date-card b{font-size:16px}
.summary,.dashboard{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  padding:12px;
  margin-bottom:14px;
}
.summary div,.dashboard div{
  background:rgba(2,6,23,.68);
  border:1px solid var(--border);
  border-radius:20px;
  padding:13px;
  min-height:78px;
}
.summary span,.dashboard span{display:block;color:var(--muted);font-size:12px;margin-bottom:7px}
.summary b,.dashboard b{font-size:17px;line-height:1.4}
.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-bottom:14px;
}
button{
  border:0;
  border-radius:20px;
  color:white;
  font-family:inherit;
  font-weight:800;
  cursor:pointer;
  transition:transform .14s ease, filter .14s ease, opacity .14s ease;
}
button:active{transform:scale(.97);filter:brightness(.95)}
.grid button{
  min-height:70px;
  font-size:16px;
  padding:14px;
  box-shadow:0 12px 25px rgba(0,0,0,.18);
}
.green{background:linear-gradient(135deg,#16a34a,#22c55e)}
.red{background:linear-gradient(135deg,#b91c1c,#ef4444)}
.blue{background:linear-gradient(135deg,#1d4ed8,#3b82f6)}
.amber{background:linear-gradient(135deg,#d97706,#f59e0b);color:#111827}
.purple{background:linear-gradient(135deg,#6d28d9,#8b5cf6)}
.cyan{background:linear-gradient(135deg,#0e7490,#06b6d4)}
.card{
  padding:16px;
  margin-bottom:14px;
}
.head{display:flex;justify-content:space-between;align-items:center;gap:8px}
h2,h3{margin:0 0 12px;font-size:19px}
.small{
  background:rgba(51,65,85,.92);
  padding:10px 13px;
  font-size:14px;
  border:1px solid rgba(148,163,184,.14);
}
.wide{width:100%;margin-top:8px}
.danger{background:linear-gradient(135deg,#7f1d1d,#b91c1c)}
pre{
  background:rgba(2,6,23,.75);
  border:1px solid var(--border);
  border-radius:20px;
  padding:14px;
  white-space:pre-wrap;
  line-height:1.9;
  font-family:inherit;
  min-height:60px;
  color:#e5e7eb;
}
.report{
  display:grid;
  grid-template-columns:160px 1fr 1fr;
  gap:8px;
  margin:10px 0;
}
.actions3{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
  margin-bottom:10px;
}
input,textarea,select{
  width:100%;
  background:rgba(2,6,23,.78);
  color:white;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  font-size:16px;
  font-family:inherit;
  outline:none;
  margin:7px 0 10px;
}
input:focus,textarea:focus,select:focus{
  border-color:rgba(96,165,250,.75);
  box-shadow:0 0 0 4px rgba(59,130,246,.12);
}
textarea{min-height:112px;resize:vertical}
label{color:#cbd5e1;font-size:14px;display:block;margin-top:10px}
.list{display:grid;gap:9px}
.item{
  background:rgba(2,6,23,.68);
  border:1px solid var(--border);
  border-radius:20px;
  padding:13px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.item p{margin:0;line-height:1.7}
.item-actions{display:flex;gap:7px;flex-wrap:wrap}
.mini{
  padding:8px 11px;
  font-size:12px;
  border-radius:14px;
  background:rgba(51,65,85,.96);
  border:1px solid rgba(148,163,184,.12);
}
.table-wrap{
  overflow:auto;
  background:rgba(2,6,23,.72);
  border:1px solid var(--border);
  border-radius:20px;
  padding:8px;
}
.muted{color:var(--muted)}
table{
  width:100%;
  border-collapse:collapse;
  min-width:560px;
  background:#fff;
  color:#111827;
  direction:rtl;
  border-radius:14px;
  overflow:hidden;
}
th,td{
  border:1px solid #cbd5e1;
  padding:10px;
  text-align:right;
  vertical-align:top;
  white-space:pre-wrap;
}
th{background:#e2e8f0;font-weight:800}
.report-title{
  background:#fff;
  color:#111827;
  text-align:center;
  padding:14px;
  font-weight:800;
  border:1px solid #cbd5e1;
  border-bottom:0;
  border-radius:14px 14px 0 0;
}
.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.62);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px;
  z-index:10;
}
.modal-box{
  width:min(760px,100%);
  padding:16px;
  max-height:90vh;
  overflow:auto;
  animation:sheet .18s ease-out;
}
@keyframes sheet{from{transform:translateY(20px);opacity:.7}to{transform:translateY(0);opacity:1}}
.x{
  width:40px;
  height:40px;
  background:rgba(31,41,55,.95);
  font-size:24px;
}
.actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.save{background:linear-gradient(135deg,#1d4ed8,#3b82f6);padding:14px}
.cancel{background:#475569;padding:14px}
.login-screen{
  position:fixed;
  inset:0;
  z-index:999;
  background:
    radial-gradient(circle at 80% 0%, rgba(59,130,246,.22), transparent 38%),
    radial-gradient(circle at 15% 10%, rgba(139,92,246,.2), transparent 34%),
    linear-gradient(180deg,#020617,#0f172a);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.login-card{
  width:min(460px,100%);
  padding:24px;
}
.login-card h1{font-size:30px}
.login-card p{color:var(--muted);line-height:1.7}
.primary{
  width:100%;
  background:linear-gradient(135deg,#1d4ed8,#3b82f6);
  padding:15px;
  font-size:17px;
  margin-top:6px;
}
.secondary{
  width:100%;
  background:rgba(51,65,85,.96);
  padding:15px;
  font-size:17px;
  margin-top:10px;
}
.error{color:#fca5a5;min-height:24px}
@media(max-width:760px){
  body{padding:10px}
  .top{position:relative;top:auto}
  .summary,.dashboard{grid-template-columns:1fr 1fr}
  .grid{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
  .top{flex-direction:column;align-items:stretch}
  .date-card{text-align:right}
  .grid,.report,.actions3{grid-template-columns:1fr}
  .item{flex-direction:column}
  .item-actions{width:100%}
  .mini{flex:1}
  h1{font-size:25px}
}

#statusView{color:#bfdbfe}
#syncStatus{color:#86efac}

.selected-date-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:28px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  padding:14px;
  margin-bottom:14px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:12px;
  align-items:center;
}
.selected-date-card span{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.selected-date-card b{font-size:20px}
.selected-date-actions{
  display:grid;
  grid-template-columns:180px auto auto;
  gap:8px;
  align-items:center;
}
.selected-date-actions input{margin:0}
.date-warning{
  color:#fde68a;
  background:rgba(245,158,11,.12);
  border:1px solid rgba(245,158,11,.28);
  display:inline-block;
  border-radius:12px;
  padding:6px 9px;
  margin:8px 0 0;
  font-size:13px;
}
@media(max-width:760px){
  .selected-date-card{grid-template-columns:1fr}
  .selected-date-actions{grid-template-columns:1fr}
}
