/* style3.css - واجهة v3: أزرار 3D بحركة ضغط، نوافذ بيانات غائرة كالشاشات، ساعة، بلاطات الحركات */
:root { --bezel:#cfc6b6; --hi:#ffffffcc; --shd:#00000026; --edge:#d9d0c0; --tile1:#fdba74; --tile2:#ea580c; --tileEdge:#9a3412; }
:root[data-theme=dark] { --bezel:#000; --hi:#ffffff14; --shd:#000000a0; --edge:#000; --tile1:#fb923c; --tile2:#c2410c; --tileEdge:#431407; }
button { transition: transform .08s ease, box-shadow .08s ease, filter .15s; -webkit-tap-highlight-color: transparent; user-select: none; }
button:disabled { opacity:.55; filter:grayscale(.4); cursor:not-allowed; }

/* ===== أزرار 3D ===== */
button.primary, button.wa, button.danger, button.ghost, .btn3d, .tb, .subnav button, .chip {
  position:relative; border:1px solid transparent; border-radius:12px; font-weight:700; cursor:pointer;
}
button.primary { background:linear-gradient(180deg,#fdba74 0%,#fb923c 35%,#ea580c 100%); color:#fff; text-shadow:0 1px 0 #7c2d12aa; padding:10px 16px; border-color:#c2410c;
  box-shadow:0 5px 0 #9a3412, 0 9px 14px #0000003d, inset 0 1px 0 #ffffff80; }
button.primary.alt { background:linear-gradient(180deg,#86efac 0%,#22c55e 40%,#15803d 100%); border-color:#166534; box-shadow:0 5px 0 #14532d, 0 9px 14px #0000003d, inset 0 1px 0 #ffffff80; }
button.wa { background:linear-gradient(180deg,#86efac,#22c55e 45%,#16a34a); color:#fff; text-shadow:0 1px 0 #14532daa; padding:9px 14px; border-color:#15803d; box-shadow:0 4px 0 #166534, 0 8px 12px #0000003a, inset 0 1px 0 #ffffff80; }
button.danger { background:linear-gradient(180deg,#fff1f2,#fecaca); color:#b91c1c; padding:7px 11px; border-color:#fca5a5; box-shadow:0 3px 0 #ef4444aa, 0 6px 10px #0000002a, inset 0 1px 0 #fff; }
button.ghost, .btn3d { background:linear-gradient(180deg,var(--card),var(--soft)); color:var(--acc2); padding:8px 12px; border-color:var(--bd); box-shadow:0 3px 0 var(--edge), 0 6px 10px #0000001f, inset 0 1px 0 var(--hi); }
.btn3d { display:inline-flex; align-items:center; justify-content:center; gap:6px; text-align:center; font-size:13px; padding:12px 14px; }
button.primary:active:not(:disabled), button.wa:active:not(:disabled), button.danger:active:not(:disabled), button.ghost:active:not(:disabled), .btn3d:active, .tb:active, .subnav button:active, .chip:active {
  transform:translateY(4px); box-shadow:0 0 0 transparent, inset 0 3px 7px #0000004d; }
.tb { background:linear-gradient(180deg,var(--card),var(--soft)); border:1px solid var(--bd); border-radius:11px; padding:6px 10px; box-shadow:0 3px 0 var(--edge), inset 0 1px 0 var(--hi); }
.subnav button { background:linear-gradient(180deg,var(--card),var(--soft)); border:1px solid var(--bd); box-shadow:0 3px 0 var(--edge), inset 0 1px 0 var(--hi); padding:8px 12px; }
.subnav button.on { background:linear-gradient(180deg,#ea580c,#fb923c); color:#fff; box-shadow:inset 0 3px 7px #0000005c; transform:translateY(2px); }
.chips { display:flex; gap:8px; flex-wrap:wrap; } .chip { background:linear-gradient(180deg,var(--card),var(--soft)); border:1px solid var(--bd); padding:6px 12px; font-size:12.5px; color:var(--acc2); box-shadow:0 3px 0 var(--edge); }
.mini-b { padding:4px 9px !important; font-size:12px !important; margin-inline-start:6px; }
.saveBtn { width:100%; padding:13px !important; font-size:15px !important; margin-top:6px; }
.actionsRow, .cardActions { gap:10px !important; }

/* ===== نوافذ البيانات: غائرة كالشاشة (إطار + عمق) ===== */
.panel { background:linear-gradient(180deg,var(--card),var(--soft)); border:1px solid var(--bd); border-radius:20px;
  box-shadow:0 12px 26px -10px var(--shd), 0 3px 0 var(--edge), inset 0 1px 0 var(--hi); }
.panel h2 { text-shadow:0 1px 0 var(--hi); }
.card, .balanceCard, .statementBox, .payBox, .tableWrap.screen, .formPanel, .attBox {
  background:linear-gradient(180deg,#0000000a,transparent 28%), var(--soft);
  border:2px solid var(--bezel); border-radius:14px;
  box-shadow:inset 0 4px 10px var(--shd), inset 0 -2px 0 var(--hi), 0 1px 0 var(--hi); }
.card { border-right:5px solid var(--acc); }
.balanceCard strong { text-shadow:0 2px 0 var(--hi); letter-spacing:.3px; }
.tableWrap.screen { padding:2px; overflow:auto; }
.tableWrap.screen table { background:var(--card); border-radius:10px; overflow:hidden; }
input, select, textarea { border:1.5px solid var(--bd); box-shadow:inset 0 3px 6px #0000001a; }
input:focus, select:focus, textarea:focus { outline:0; border-color:var(--acc); box-shadow:inset 0 3px 6px #0000001a, 0 0 0 3px #ea580c33; }
.searchIn { width:100%; padding:10px; margin:0 0 8px; border-radius:11px; }
.modal { border:1px solid var(--bd); border-top:6px solid var(--acc); border-radius:20px; box-shadow:0 30px 70px #000a, 0 4px 0 var(--edge), inset 0 1px 0 var(--hi); }
.modal-backdrop { backdrop-filter:blur(3px); }
.subH { margin:12px 0 4px; font-size:13px; color:var(--acc2); }
.fHint { color:var(--mut); font-size:11px; } .field.chk span { display:flex; align-items:center; gap:8px; }
.linkBadge { width:100%; background:#fef3c7; color:#78350f; border-radius:9px; padding:5px 9px; font-size:11.5px; } [data-theme=dark] .linkBadge { background:#422006; color:#fde68a; }
.payBox { padding:10px 12px; margin:10px 0; } .payRow { display:flex; justify-content:space-between; padding:4px 0; font-size:14px; }
.limBar { height:8px; border-radius:8px; background:var(--bd); box-shadow:inset 0 2px 3px #0003; margin:6px 0; overflow:hidden; } .limBar i { display:block; height:100%; background:var(--ok); } .limBar i.warn { background:#f59e0b; } .limBar i.bad { background:var(--bad); }
.mini3 { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:10px 0; }
.pickRow { display:flex; justify-content:space-between; padding:12px; border:1px solid var(--bd); border-radius:12px; margin-bottom:8px; cursor:pointer; background:linear-gradient(180deg,var(--card),var(--soft)); box-shadow:0 3px 0 var(--edge); } .pickRow:active { transform:translateY(3px); box-shadow:none; }

/* ===== بلاطات الحركات السريعة ===== */
.tileGroup h3 { margin:12px 0 8px; font-size:13px; color:var(--acc2); }
.tiles { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
@media (min-width:640px) { .tiles { grid-template-columns:repeat(4,1fr); } }
.tile { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:88px; padding:10px 6px; border:1px solid #c2410c55; border-radius:18px; color:#fff; cursor:pointer;
  background:linear-gradient(180deg,var(--tile1),var(--tile2)); box-shadow:0 6px 0 var(--tileEdge), 0 12px 18px #0000003a, inset 0 2px 0 #ffffff66; }
.tile:nth-child(3n+2) { background:linear-gradient(180deg,#a8a29e,#57534e); box-shadow:0 6px 0 #292524, 0 12px 18px #0000003a, inset 0 2px 0 #ffffff55; }
.tile:nth-child(3n) { background:linear-gradient(180deg,#fcd34d,#d97706); box-shadow:0 6px 0 #92400e, 0 12px 18px #0000003a, inset 0 2px 0 #ffffff66; }
.tile .ti { font-size:28px; filter:drop-shadow(0 2px 2px #0006); } .tile .tt { font-size:12px; font-weight:800; text-shadow:0 1px 0 #0006; text-align:center; line-height:1.3; }
.tile:active { transform:translateY(6px); box-shadow:0 0 0 transparent, inset 0 4px 10px #0006 !important; }

/* ===== الساعة (تناظرية + رقمية) ===== */
.clock-card { display:flex; align-items:center; justify-content:center; gap:22px; flex-wrap:wrap; background:linear-gradient(145deg,#57534e,#292524 60%,#1c1917); color:#fdf8ec; border-radius:24px; padding:16px 22px; margin-bottom:14px;
  border:2px solid #0c0a09; box-shadow:0 7px 0 #0c0a09, 0 16px 28px #0005, inset 0 2px 0 #ffffff33, inset 0 -6px 14px #0008; position:relative; overflow:hidden; }
.clock-card::before { content:''; position:absolute; inset:0; opacity:.07; pointer-events:none; background-image:repeating-linear-gradient(45deg,#fbbf24 0 2px,transparent 2px 22px); }
.clock-card .analog { width:150px; height:150px; flex-shrink:0; filter:drop-shadow(0 8px 10px #0008); position:relative; }
.cf-face { fill:#fffdf8; } .cf-ring { fill:none; stroke:#f59e0b; stroke-width:7; }
.tk { stroke:#8a7a5c; stroke-width:1.2; } .tk-big { stroke:#2b241a; stroke-width:3; }
.cf-num { font-size:15px; font-weight:800; fill:#2b241a; font-family:Tahoma,sans-serif; }
.hand-h { stroke:#9a3412; stroke-width:6; stroke-linecap:round; } .hand-m { stroke:#2b241a; stroke-width:4; stroke-linecap:round; } .hand-s { stroke:#dc2626; stroke-width:2; stroke-linecap:round; } .cf-pin { fill:#dc2626; stroke:#fff; stroke-width:2; }
.digital { text-align:center; position:relative; }
.clock-time { font-size:36px; font-weight:800; letter-spacing:2px; color:#fbbf24; font-variant-numeric:tabular-nums; text-shadow:0 3px 0 #0c0a09, 0 0 14px #f59e0b66; background:#0c0a09; border-radius:12px; padding:2px 14px; box-shadow:inset 0 4px 10px #000; }
.clock-date { font-size:15px; font-weight:700; margin-top:8px; } .clock-hijri { font-size:13px; margin-top:2px; color:#fcd34d; }

/* ===== المرفقات ===== */
.attBox { padding:10px; } .attBtns { display:grid; grid-template-columns:1fr 1fr; gap:10px; } .attBtns.big { margin-bottom:10px; } .attBtns .btn3d { min-height:54px; font-size:13.5px; }
.attGrid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:8px; } .attGrid.big { grid-template-columns:repeat(2,1fr); gap:10px; }
.attItem { position:relative; border:2px solid var(--bezel); border-radius:12px; background:var(--card); padding:6px; text-align:center; overflow:hidden; box-shadow:inset 0 2px 6px var(--shd); }
.attItem img { width:100%; height:78px; object-fit:cover; border-radius:8px; display:block; } .attItem.big img { height:130px; cursor:zoom-in; }
.attItem small { display:block; font-size:10.5px; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--mut); } .attDoc { font-size:34px; display:block; padding:14px 0 0; }
.attX { position:absolute; top:3px; left:3px; width:24px; height:24px; border-radius:50%; border:0; background:#dc2626; color:#fff; font-size:12px; box-shadow:0 2px 0 #7f1d1d; padding:0; }
.attAct { display:flex; justify-content:center; gap:8px; margin-top:4px; align-items:center; }
.attHint { margin-top:6px; } .upMsg { min-height:20px; font-size:13px; margin:4px 0 8px; } .upMsg.busy { color:var(--acc); font-weight:700; } .upMsg.err { color:var(--bad); }
#upBar { position:fixed; left:50%; transform:translateX(-50%); bottom:64px; z-index:9100; background:#ea580c; color:#fff; font-weight:700; padding:9px 18px; border-radius:30px; box-shadow:0 5px 0 #9a3412, 0 10px 18px #0005; font-size:13px; }
.lightbox { position:fixed; inset:0; background:#000e; z-index:9500; display:flex; align-items:center; justify-content:center; padding:10px; } .lightbox img { max-width:100%; max-height:100%; border-radius:10px; }

/* ===== التوقيع ===== */
.sigCanvas { width:100%; max-width:360px; height:130px; background:#fff; border:2px dashed #94a3b8; border-radius:12px; touch-action:none; box-shadow:inset 0 3px 8px #0002; display:block; margin:8px 0; }
.sigSaved { background:#fff; border:2px solid var(--bezel); border-radius:12px; padding:8px; text-align:center; box-shadow:inset 0 3px 8px #0002; } .sigSaved img { height:72px; max-width:100%; object-fit:contain; pointer-events:none; }

/* ===== الحضور ===== */
.dateNav { display:flex; gap:8px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin-bottom:6px; } .dateNav input { flex:1; min-width:140px; text-align:center; font-weight:700; }
.attRow { display:grid; grid-template-columns:1fr 130px 90px; gap:8px; align-items:center; padding:9px 4px; border-bottom:1px dashed var(--bd); } .attName small { display:block; }
@media (max-width:520px) { .attRow { grid-template-columns:1fr 1fr; } .attName { grid-column:1/-1; } }
select.st-ok { background:#dcfce7; border-color:#22c55e; } select.st-bad { background:#fee2e2; border-color:#ef4444; } select.st-half { background:#fef3c7; border-color:#f59e0b; } select.st-leave { background:#dbeafe; border-color:#3b82f6; } select.st-unpaid { background:#e5e7eb; border-color:#6b7280; }
[data-theme=dark] select.st-ok { background:#14532d; } [data-theme=dark] select.st-bad { background:#7f1d1d; } [data-theme=dark] select.st-half { background:#78350f; } [data-theme=dark] select.st-leave { background:#1e3a8a; } [data-theme=dark] select.st-unpaid { background:#374151; }
.empPick { display:grid; grid-template-columns:repeat(2,1fr); gap:6px; margin:8px 0; max-height:220px; overflow:auto; padding:4px; } .pick { display:flex; gap:6px; align-items:center; background:var(--card); border:1px solid var(--bd); border-radius:10px; padding:8px; font-size:13px; } .selAll { margin-top:8px; font-weight:700; }
.dayGrid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; } .dayChip { border-radius:10px; text-align:center; padding:5px 2px; font-size:12px; border:1px solid var(--bd); box-shadow:0 2px 0 var(--edge); } .dayChip b { display:block; } .dayChip small { display:block; font-size:9px; }
.dayChip.st-ok { background:#dcfce7; } .dayChip.st-bad { background:#fee2e2; } .dayChip.st-half { background:#fef3c7; } .dayChip.st-leave { background:#dbeafe; } .dayChip.st-unpaid { background:#e5e7eb; } .dayChip.st-none { background:var(--soft); color:var(--mut); }
[data-theme=dark] .dayChip { color:#111; }

/* ===== القائمة الجانبية والشريط العلوي ===== */
.nav-link { margin:3px 8px; border-radius:11px; border-right:0 !important; } .nav-link:hover { background:#ffffff1c; transform:translateX(-2px); }
.nav-link.active { background:linear-gradient(180deg,#ea580c,#c2410c) !important; box-shadow:0 3px 0 #7c2d12, inset 0 1px 0 #ffffff55; color:#fff; }
#topbar { box-shadow:0 4px 0 var(--edge), 0 8px 14px -6px var(--shd); position:relative; z-index:5; }
#topDate { font-size:10.5px; color:var(--mut); font-weight:400; display:block; line-height:1.2; }
#pageTitle { line-height:1.25; }
.pill { cursor:pointer; box-shadow:0 2px 0 #0002; }
@media print { .tiles, .clock-card { display:none; } }

@media (max-width:700px) { #role-badge { display:none; } #topDate { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; } #pageTitle { min-width:0; overflow:hidden; } #topbar { gap:6px; padding:8px; } .tb { padding:6px 8px; } }
.qrBox { background:#fff; border-radius:12px; padding:6px; display:inline-block; box-shadow:inset 0 2px 6px #0003, 0 4px 0 var(--edge); } .qrBox.sm { flex-shrink:0; width:112px; height:112px; padding:4px; } .qrBox svg { width:100%; height:100%; display:block; }
.linkRow { display:flex; gap:12px; align-items:center; margin:8px 0; } .urlBox { background:var(--card); border:2px solid var(--bezel); border-radius:10px; padding:8px 10px; font-size:12px; word-break:break-all; box-shadow:inset 0 3px 7px var(--shd); user-select:all; }
.btnGrid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; } .btnGrid > * { min-height:44px; }
.inviteTxt { white-space:pre-wrap; font-family:inherit; font-size:12.5px; margin:0; color:var(--tx); } .dangerCard { border-right-color:#dc2626 !important; }
button.danger.big { padding:10px 14px; font-size:14px; }
@media (max-width:700px){ .attRow{grid-template-columns:1fr 1fr; } .attRow .attName{grid-column:1/-1;} .attRow input,.attRow select{min-width:0;width:100%;box-sizing:border-box;} }
