:root {
  --bg: #fdf8ef;
  --card: #ffffff;
  --ink: #1f2a37;
  --muted: #6b7280;
  --line: #efe6d6;
  --green: #1b7a4a;
  --green-2: #2fa96b;
  --green-soft: #e3f5ea;
  --orange: #f08a24;
  --orange-soft: #fff0df;
  --blue: #2563eb;
  --blue-soft: #e5edff;
  --purple: #7c3aed;
  --purple-soft: #f0e9ff;
  --abs: #e03a3a;
  --abs-soft: #ffe7e7;
  --today: #fff6cc;
  --radius: 18px;
  --shadow: 0 6px 24px -10px rgba(60, 40, 10, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--ink); font: 16px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 400px at 100% 0, rgba(240,138,36,.10), transparent 60%),
    radial-gradient(700px 400px at 0 100%, rgba(47,169,107,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--green); }
h1 { font-size: 1.6rem; font-weight: 900; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .85rem; display: flex; align-items: center; gap: .5rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- Antet ---------- */
.top {
  background: linear-gradient(120deg, #145c38 0%, var(--green) 45%, var(--green-2) 100%);
  color: #fff; position: relative; box-shadow: 0 4px 18px -8px rgba(20, 92, 56, .6);
}
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--orange), #ffc857, var(--orange));
}
.top-in { max-width: 1200px; margin: 0 auto; padding: .7rem 1rem .4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; min-width: 0; }
.logo { width: 58px; height: 64px; object-fit: contain; background: #fff; border-radius: 16px; padding: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.18); flex: none; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 900; font-size: 1.15rem; line-height: 1.2; }
.brand-sub { font-size: .82rem; opacity: .9; font-weight: 600; }
.cine { display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.15); padding: .3rem .8rem .3rem .3rem; border-radius: 99px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.cine .av { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; font-size: .8rem; font-weight: 900; }
.tabs { max-width: 1200px; margin: 0 auto; padding: 0 1rem .8rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; color: #fff; text-decoration: none; font-weight: 700; padding: .5rem 1rem; border-radius: 99px; background: rgba(255,255,255,.12); transition: background .15s, transform .15s; }
.tabs a:hover { background: rgba(255,255,255,.24); transform: translateY(-1px); }
.tabs a.on { background: #fff; color: var(--green); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.tabs a.t-iesire { margin-left: auto; background: transparent; border: 1.5px solid rgba(255,255,255,.4); }
@media (max-width: 640px) {
  .logo { width: 46px; height: 50px; border-radius: 12px; }
  .brand-name { font-size: .98rem; }
  .brand-sub { font-size: .74rem; }
  .cine-n { display: none; }
  .cine { padding: .25rem; }
  .tabs a { padding: .45rem .75rem; font-size: .9rem; }
  .tabs a.t-iesire span { display: none; }
}

main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.6rem 1rem 3rem; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.flash { padding: .8rem 1.1rem; border-radius: 14px; margin-bottom: 1rem; background: var(--green-soft); color: var(--green); font-weight: 700; border-left: 5px solid var(--green-2); }
.flash.err { background: var(--abs-soft); color: var(--abs); border-color: var(--abs); }
.flash.info { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 2px solid var(--line); background: #fff; color: var(--ink); padding: .55rem 1.1rem; border-radius: 12px; font: 700 .95rem "Nunito", system-ui, sans-serif; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s, filter .12s; }
.btn:hover { transform: translateY(-1px); border-color: #e2d4bb; }
.btn.primary { background: linear-gradient(135deg, var(--orange), #f5a53f); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(240,138,36,.7); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.green { background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(27,122,74,.6); }
.btn.danger { color: var(--abs); }
.btn.danger:hover { background: var(--abs-soft); border-color: #f7c1c1; }
.btn.sm { padding: .3rem .7rem; font-size: .84rem; border-radius: 10px; }
.btn.wide { width: 100%; margin-top: .9rem; }
.btn.big { padding: .85rem 1.1rem; font-size: 1.05rem; }
input, select { font: 600 .95rem "Nunito", system-ui, sans-serif; padding: .55rem .75rem; border: 2px solid var(--line); border-radius: 12px; background: #fffdf8; color: var(--ink); max-width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(47,169,107,.15); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
label.inline { display: inline-flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--muted); font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.stack label { display: flex; flex-direction: column; gap: .25rem; font-size: .86rem; color: var(--muted); font-weight: 700; }
.toolbar { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.1rem; }
.toolbar input[type=search] { flex: 1; min-width: 170px; padding-left: 2.2rem; background: #fffdf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%239ca3af' stroke-width='2.5' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .7rem center; }
.hint { margin-left: auto; align-self: center; background: var(--orange-soft); color: #9a520c; padding: .4rem .8rem; border-radius: 10px; }
.pill { background: var(--green-soft); color: var(--green); border-radius: 99px; padding: .05rem .6rem; font-size: .82rem; font-weight: 800; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--orange-soft); color: #b45309; }

/* ---------- Login ---------- */
.p-index .top { display: none; }
.p-index main { display: grid; place-items: center; padding-top: 2rem; }
.login { width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.1fr 1fr; border-radius: 28px; overflow: hidden; box-shadow: 0 30px 60px -25px rgba(60,40,10,.35); background: #fff; }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 2.5rem 2rem; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  background: linear-gradient(150deg, #145c38, var(--green) 50%, var(--green-2)); }
.login-hero h1 { font-size: 1.75rem; line-height: 1.2; position: relative; }
.hero-sub { margin: 0; opacity: .95; position: relative; }
.login-logo { width: 150px; height: auto; background: #fff; border-radius: 28px; padding: 10px; box-shadow: 0 14px 30px rgba(0,0,0,.25); position: relative; transform: rotate(-3deg); }
.chip { position: relative; margin-top: .4rem; background: var(--orange); color: #fff; font-weight: 800; padding: .35rem 1rem; border-radius: 99px; font-size: .9rem; box-shadow: 0 6px 14px -6px rgba(0,0,0,.4); }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .35; }
.b1 { width: 260px; height: 260px; background: #ffc857; top: -80px; left: -90px; }
.b2 { width: 200px; height: 200px; background: var(--orange); bottom: -70px; right: -60px; }
.b3 { width: 90px; height: 90px; background: #9be7c0; top: 40%; right: 12%; }
.login-card { padding: 2.2rem 2rem; text-align: center; }
.lock { font-size: 2.2rem; }
.login-card h2 { justify-content: center; font-size: 1.5rem; margin: .2rem 0 .1rem; }
.pin-input { width: 100%; text-align: center; font-size: 1.9rem; letter-spacing: .4em; padding: .55rem; margin-top: .8rem; border-radius: 16px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-top: .9rem; }
.keypad button { font: 800 1.35rem "Nunito", system-ui, sans-serif; padding: .7rem 0; border: 2px solid var(--line); border-radius: 16px; background: #fffdf8; cursor: pointer; color: var(--ink); transition: transform .1s, background .1s; }
.keypad button:hover { background: var(--green-soft); border-color: #bfe6cf; }
.keypad button:active { transform: scale(.94); }
.keypad button[data-k="⌫"] { color: var(--abs); }
.keypad button[data-k="✓"] { background: var(--green); color: #fff; border-color: var(--green); }
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; border-radius: 22px; }
  .login-hero { padding: 1.8rem 1.2rem; }
  .login-logo { width: 110px; }
  .login-hero h1 { font-size: 1.35rem; }
  .login-card { padding: 1.6rem 1.2rem; }
}

/* ---------- Statistici ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.1rem; }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat b { font-size: 2rem; font-weight: 900; line-height: 1.1; }
.stat span:last-child { font-weight: 700; font-size: .88rem; opacity: .85; }
.st-ic { position: absolute; right: .8rem; top: .7rem; font-size: 1.6rem; opacity: .9; }
.s-blue { background: linear-gradient(135deg, #dbe7ff, #eef3ff); color: #1d4ed8; }
.s-green { background: linear-gradient(135deg, #d4f3e1, #ecfaf2); color: var(--green); }
.s-orange { background: linear-gradient(135deg, #ffe2c4, #fff2e4); color: #c2410c; }
.s-purple { background: linear-gradient(135deg, #e7dcff, #f4efff); color: var(--purple); }

/* ---------- Alegere elevi ---------- */
.pick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
@media (max-width: 600px) { .pick { grid-template-columns: 1fr; } }
.pick label { display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; border-radius: 14px; cursor: pointer; border: 2px solid transparent; background: #fffaf1; transition: background .12s, border-color .12s; }
.pick label:hover { background: var(--orange-soft); }
.pick label:has(input:checked) { background: var(--green-soft); border-color: #9fdcba; }
.pick input { width: 1.25rem; height: 1.25rem; accent-color: var(--green); flex: none; }
.pick input:checked ~ .nm { color: var(--green); }
.pick .nm { line-height: 1.25; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .78rem; color: #fff; flex: none; }
.av.c0 { background: #f08a24; } .av.c1 { background: #2fa96b; } .av.c2 { background: #3b82f6; }
.av.c3 { background: #8b5cf6; } .av.c4 { background: #ec4899; } .av.c5 { background: #14b8a6; }
.alesi { margin: 0; padding-left: 1.6rem; max-height: 55vh; overflow: auto; }
.alesi li { padding: .3rem 0; font-weight: 600; border-bottom: 1px dashed var(--line); }
.alesi li::marker { color: var(--orange); font-weight: 900; }

/* ---------- Catalog interactiv ---------- */
.grid-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 16px; }
.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 480px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; }
.grid thead th { background: linear-gradient(180deg, #e9f7ef, #dcf1e5); font-size: .78rem; font-weight: 800; color: var(--green); padding: .5rem .3rem; position: relative; }
.grid .c-nr { width: 2.8rem; color: var(--muted); font-size: .85rem; font-weight: 700; }
.grid .c-nume { text-align: left; padding: .55rem .8rem; min-width: 220px; position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; }
.grid thead .c-nume { background: #e3f4ea; z-index: 2; }
.grid tbody tr:nth-child(even) td { background-color: #fffbf4; }
.grid tbody tr:nth-child(even) .c-nume { background: #fffbf4; }
.grid .c-zi { min-width: 62px; }
.grid thead .c-zi.azi { background: linear-gradient(180deg, #ffe89a, #ffdf7a); color: #7a4b00; }
.zi-sapt { display: block; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; }
.zi-data { display: block; font-size: .95rem; color: var(--ink); font-weight: 900; }
.del-sed { position: absolute; top: 2px; right: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 5px; border-radius: 6px; opacity: .35; }
.c-zi:hover .del-sed, .del-sed:focus { opacity: 1; }
.del-sed:hover { color: #fff; background: var(--abs); }
.grid tbody .cel.azi { background-color: var(--today) !important; }
.grid .cel button { width: 100%; height: 44px; border: 0; background: transparent; cursor: pointer; font: 900 .78rem "Nunito", system-ui, sans-serif; color: #fff; letter-spacing: .04em; transition: background .12s; }
.grid .cel button:hover { background: rgba(224,58,58,.08); }
.grid .cel button:hover::after { content: "+"; color: var(--abs); opacity: .5; font-size: 1.1rem; }
.grid .cel.abs button { background: var(--abs); border-radius: 10px; width: calc(100% - 8px); height: 36px; margin: 4px; box-shadow: 0 4px 10px -4px rgba(224,58,58,.7); text-transform: uppercase; animation: pop .18s ease-out; }
.grid .cel.abs button:hover::after { content: none; }
@keyframes pop { from { transform: scale(.7); } to { transform: scale(1); } }
.grid .cel.busy button { opacity: .5; }
.grid .c-tot { width: 4.8rem; font-weight: 900; }
.grid .c-tot .tot { display: inline-block; min-width: 2rem; padding: .15rem .5rem; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.grid tr.are-abs .tot { background: var(--abs-soft); color: var(--abs); }
.grid tfoot td { font-size: .82rem; font-weight: 800; color: var(--green); padding: .45rem 0; background: #f3faf6; }
.grid tfoot .c-nume { background: #f3faf6; }
.legend { display: flex; gap: 1.2rem; margin-top: .8rem; font-size: .88rem; color: var(--muted); align-items: center; flex-wrap: wrap; font-weight: 700; }
.sw { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--line); vertical-align: -3px; margin-right: .3rem; }
.sw.abs { background: var(--abs); border-color: var(--abs); }
.sw.azi { background: var(--today); border-color: #f5d76e; }
.saved { margin-left: auto; color: var(--green); }
.saved.err { color: var(--abs); }
.empty { text-align: center; padding: 2.5rem 1rem; }
.empty-ic { font-size: 3rem; }

/* ---------- Admin ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .78rem; color: var(--green); font-weight: 800; padding: .6rem; background: #eef8f2; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
table.list th:first-child { border-radius: 10px 0 0 10px; }
table.list th:last-child { border-radius: 0 10px 10px 0; }
table.list td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr:hover td { background: #fffaf1; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
table.list tr.inactiv td { opacity: .5; }
.actions { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.actions form { margin: 0; }
.inline-form select { padding: .3rem .5rem; font-size: .88rem; border-radius: 10px; }

.pins { border: 3px solid var(--orange); }
.slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.slip { border: 2px dashed #d6c7ab; border-radius: 16px; padding: .8rem; text-align: center; break-inside: avoid; background: #fffdf8; }
.slip img { width: 40px; }
.s-school { font-size: .7rem; color: var(--muted); font-weight: 700; }
.s-name { font-weight: 900; margin-top: .3rem; }
.s-cls { font-size: .85rem; color: var(--muted); }
.s-pin { font: 800 1.8rem ui-monospace, Consolas, monospace; letter-spacing: .2em; margin: .35rem 0; color: var(--green); }
.s-url { font-size: .74rem; color: var(--orange); font-weight: 800; }

@media print {
  .top, .noprint, .flash, .pins .btn, .foot { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; box-shadow: none; }
  .slips { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Luni, activități programate ---------- */
.luni { display: flex; gap: .35rem; flex-wrap: wrap; }
.luni a { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: .35rem .6rem; border-radius: 12px; background: #fffaf1; border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 800; line-height: 1.1; transition: transform .12s, background .12s; }
.luni a small { font-size: .68rem; color: var(--muted); font-weight: 700; }
.luni a:hover { background: var(--orange-soft); transform: translateY(-1px); }
.luni a.curenta { border-color: #f5c27d; }
.luni a.on { background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 14px -6px rgba(27,122,74,.6); }
.luni a.on small { color: rgba(255,255,255,.85); }
.next { margin: -.3rem 0 1rem; background: var(--blue-soft); color: #1e40af; padding: .55rem .9rem; border-radius: 12px; font-size: .92rem; }
.stat b small { font-size: 1rem; opacity: .6; font-weight: 800; }
.grid .c-tot small { display: block; font-weight: 600; font-size: .66rem; opacity: .8; }
.grid thead .c-zi.viitor { background: #f4f4f5; color: #9ca3af; }
.grid thead .c-zi.viitor .zi-data { color: #9ca3af; }
.grid tbody .cel.viitor { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.035) 6px 12px); }
.grid .cel button:disabled { cursor: not-allowed; }
.grid .cel button:disabled:hover { background: transparent; }
.grid .cel button:disabled:hover::after { content: none; }
.sw.viitor { background: repeating-linear-gradient(135deg, #fff 0 3px, #e5e7eb 3px 6px); }
.vac { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.vac li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem .7rem; background: #fffaf1; border-radius: 12px; border-left: 4px solid var(--orange); }
.vac form { margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.nowrap { white-space: nowrap; }
