/* Modern UI - PDF Reply Assistant (V2)
   Responsive, RTL/LTR friendly, Cairo font.
*/
:root{
  --bg:#0b1220;
  --text:#e8eefc;
  --muted:#9db0d0;
  --border:rgba(255,255,255,.10);
  --accent:#66e0a3;
  --danger:#ff6b6b;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:16px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% -10%, rgba(102,224,163,.15), transparent 55%),
              radial-gradient(900px 700px at 90% 10%, rgba(79,140,255,.13), transparent 50%),
              var(--bg);
  color:var(--text);
  font-family:"Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height:1.55;
}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}
.container{width:min(1100px, 92vw); margin:28px auto 60px;}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding:18px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand{display:flex; align-items:center; gap:12px;}
.brand .logo{
  width:44px; height:44px; border-radius:14px;
  background: rgba(102,224,163,.18);
  border:1px solid rgba(102,224,163,.25);
  display:grid; place-items:center;
  font-weight:800;
}
.brand h1{margin:0; font-size:18px; letter-spacing:.2px;}
.brand small{display:block; color:var(--muted); margin-top:2px}
.grid{display:grid; grid-template-columns: 1.1fr .9fr; gap:18px; margin-top:18px;}
@media (max-width: 900px){ .grid{grid-template-columns:1fr} }
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:18px;
  box-shadow: var(--shadow);
}
.card h2,.card h3{margin:0 0 10px}
.card h2{font-size:18px}
.muted{color:var(--muted)}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  color: var(--muted);
  font-size:12px;
}
hr.sep{border:none; border-top:1px solid var(--border); margin:14px 0}
.field{display:flex; flex-direction:column; gap:6px; margin:10px 0;}
label{font-size:13px; color:var(--muted)}
input, select, textarea{
  width:100%;
  padding:12px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(102,224,163,.55);
  box-shadow: 0 0 0 4px rgba(102,224,163,.12);
}
.row{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
@media (max-width: 640px){ .row{grid-template-columns:1fr} }
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid rgba(102,224,163,.35);
  background: rgba(102,224,163,.14);
  color: var(--text);
  cursor:pointer;
  font-weight:700;
  transition:.15s ease;
}
.btn:hover{transform:translateY(-1px); background: rgba(102,224,163,.18)}
.btn:active{transform:translateY(0)}
.btn.secondary{border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06);}
.btn.danger{border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.12);}
.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius: 14px;
  border:1px solid var(--border);
}
.table th,.table td{
  padding:12px 10px;
  border-top:1px solid var(--border);
  text-align:start;
  vertical-align:top;
  font-size:14px;
}
.table th{
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-weight:700;
  border-top:none;
}
.table tr:hover td{background: rgba(255,255,255,.03)}
.kv{display:flex; flex-wrap:wrap; gap:10px;}
.kv .pill{
  padding:6px 10px; border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size:12px;
}
details.acc{
  border:1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
  background: rgba(0,0,0,.14);
  margin-top:12px;
}
details.acc > summary{
  cursor:pointer;
  padding:12px 14px;
  list-style:none;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  font-weight:800;
}
details.acc > summary::-webkit-details-marker{display:none}
details.acc .content{padding:12px 14px; border-top:1px solid var(--border);}
pre.textblock{
  margin:0;
  padding:12px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  border:1px solid var(--border);
  overflow:auto;
  max-height: 520px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
  line-height: 1.7;
}
.small{font-size:12.5px}
.alert{
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,107,107,.3);
  background: rgba(255,107,107,.1);
  color: #ffd1d1;
}
[dir="auto"]{unicode-bidi: plaintext}
.footer{margin-top:16px; text-align:center; color:var(--muted); font-size:12px;}
