/* ==========================================================================
   pro-theme.css — शिक्षक / Admin पेजहरूको थप professional रूप (v466+).

   केवल रूप (CSS) मात्र — कुनै HTML संरचना, id, class नाम वा JS बदलिएको छैन, त्यसैले हरेक बटन/फारम
   पहिलेकै काम गर्छ। लाग्ने ठाउँ: body.has-admin-bottom-nav र body.has-teacher-bottom-nav (विद्यार्थी
   Dashboard `.sd-body` र Teachers पेज `.tp` को आफ्नै डिजाइन छ — यहाँ छोइँदैन)। छापिने (print) रूपमा
   असर पर्दैन: सबै नियम @media screen भित्र।

   हटाउन परे: पेजको <link rel="stylesheet" href="css/pro-theme.css…"> मात्र हटाउनुहोस्।
   ========================================================================== */
@media screen {
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) {
    --pro-radius: 14px;
    --pro-line: #e9e3d6;
    --pro-soft: #f6f2e9;
    --pro-shadow-sm: 0 1px 2px rgba(27, 42, 74, .05), 0 1px 1px rgba(27, 42, 74, .03);
    --pro-shadow-md: 0 1px 2px rgba(27, 42, 74, .04), 0 12px 28px -16px rgba(27, 42, 74, .24);
    --pro-ring: 0 0 0 3px rgba(232, 163, 61, .28);
    background: linear-gradient(180deg, #faf7f2 0%, #f3eee3 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.55;
  }

  /* ---- डेस्कटप शीर्षक पट्टी ---------------------------------------- */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .flex-1 > header.md\:flex {
    position: relative;
    background: #fff;
    border-bottom: 1px solid var(--pro-line);
    box-shadow: var(--pro-shadow-sm);
    padding-top: 1.1rem; padding-bottom: 1.1rem;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .flex-1 > header.md\:flex::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
    background: linear-gradient(90deg, var(--gold) 0%, rgba(232, 163, 61, .18) 55%, transparent 100%);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) #desktopTitleSlot {
    display: flex; align-items: center; gap: .65rem;
    letter-spacing: -.01em; font-weight: 700;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) #desktopTitleSlot::before {
    content: ""; width: 5px; height: 1.35em; border-radius: 3px;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  }

  /* ---- कार्ड ---------------------------------------------------------- */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) main .card {
    border-radius: var(--pro-radius);
    border: 1px solid var(--pro-line);
    box-shadow: var(--pro-shadow-md);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) main .card > h2.display,
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) main .card > h3.display {
    letter-spacing: -.005em;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) main .card > h2.display:first-child {
    font-size: 1.12rem; font-weight: 700;
    display: flex; align-items: center; gap: .55rem;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) main .card > h2.display:first-child::before {
    content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--gold);
  }

  /* ---- बटन ------------------------------------------------------------ */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-primary,
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-gold {
    letter-spacing: .005em;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-primary {
    background: linear-gradient(180deg, #243659 0%, var(--ink) 100%);
    box-shadow: 0 1px 2px rgba(27, 42, 74, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-primary:hover {
    background: linear-gradient(180deg, #2f4270 0%, #243659 100%);
    box-shadow: 0 4px 12px -4px rgba(27, 42, 74, .45);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-gold {
    background: linear-gradient(180deg, #efb04f 0%, var(--gold) 100%);
    box-shadow: 0 1px 2px rgba(200, 129, 31, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-gold:hover {
    background: linear-gradient(180deg, #e8a33d 0%, var(--gold-dark) 100%);
    box-shadow: 0 4px 12px -4px rgba(200, 129, 31, .55);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-primary:disabled,
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-gold:disabled {
    opacity: .5; cursor: not-allowed; box-shadow: none; transform: none;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-cancel {
    border-radius: 10px; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .btn-cancel:hover {
    box-shadow: var(--pro-shadow-sm);
  }

  /* ---- फारम: लेबल र इनपुट --------------------------------------------- */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) label.block.font-semibold,
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-field > span {
    font-size: .78rem; font-weight: 700; color: var(--ink-light); letter-spacing: .01em;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .input-field {
    border: 1.5px solid #dfd8c8;
    border-radius: 10px;
    background-color: #fff;
    color: var(--text);
    box-shadow: inset 0 1px 1px rgba(27, 42, 74, .03);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .input-field::placeholder { color: #a8a39a; }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .input-field:hover:not(:disabled) { border-color: #cfc6b1; }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .input-field:focus {
    border-color: var(--gold); box-shadow: var(--pro-ring);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .input-field:disabled {
    background-color: var(--pro-soft); color: #8b8678; cursor: not-allowed;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) select.input-field {
    appearance: none; -webkit-appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .85rem center; background-size: .75rem;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) input[type="checkbox"] { accent-color: var(--ink); }

  /* ---- Modal (नयाँ/सम्पादन फारम) ------------------------------------- */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-overlay:not(.rt-fullpage) {
    background: rgba(20, 31, 56, .55);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-overlay.open .record-edit-box {
    animation: proPop .18s ease-out both;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-box {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: 0 24px 60px -20px rgba(20, 31, 56, .55), 0 2px 6px rgba(20, 31, 56, .12);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-header {
    position: relative;
    background: linear-gradient(180deg, #fffdf9 0%, #faf6ec 100%);
    padding: 1rem 1.35rem;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: linear-gradient(90deg, var(--gold), rgba(232, 163, 61, .1) 70%, transparent);
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-close {
    width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; transition: background .15s ease, color .15s ease;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-subheading {
    font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-light);
    padding-bottom: .35rem; border-bottom: 1px solid var(--pro-line); margin: 1rem 0 .6rem;
  }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-actions {
    background: #fbf9f3; border-top: 1px solid var(--pro-line);
  }

  /* ---- तालिका (Ledger) ------------------------------------------------ */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .ledger tbody tr { transition: background .12s ease; }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .ledger tbody tr:hover td { background-color: #fbf6e8; }

  /* ---- Unit Tests पेजका कार्ड ---------------------------------------- */
  body .ut-test-card, body .ut-roster-row, body .pw-rec {
    border: 1px solid var(--pro-line, #e9e3d6);
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(27, 42, 74, .04);
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
  }
  body .ut-roster-row { border-left-width: 1px; border-left-color: var(--pro-line, #e9e3d6); padding: .6rem .85rem; }
  body .ut-test-card:hover, body .pw-rec:hover { box-shadow: 0 8px 22px -14px rgba(27, 42, 74, .35); border-color: #e3d3ad; border-left-color: var(--gold-dark); }
  body .ut-roster-row:hover { border-color: #e3d3ad; box-shadow: 0 4px 14px -10px rgba(27, 42, 74, .3); }
  body .ut-test-title, body .pw-rec-title { font-size: .96rem; letter-spacing: -.005em; }
  body .ut-test-meta, body .pw-rec-meta { font-size: .74rem; line-height: 1.5; }
  body .ut-test-actions button, body .pw-rec-actions button {
    border-radius: 8px; padding: .34rem .7rem; transition: background .12s ease, border-color .12s ease, color .12s ease;
  }
  body .ut-test-actions button:hover, body .pw-rec-actions button:hover { background: var(--cream); }
  body .ut-test-actions .ut-delete-btn, body .pw-rec-actions button.pw-danger { background: #fff; }
  body .ut-test-actions .ut-delete-btn:hover, body .pw-rec-actions button.pw-danger:hover { background: var(--error); color: #fff; }
  body .ut-roster-avg { background: var(--pro-soft, #f6f2e9); padding: .15rem .55rem; border-radius: 999px; }
  body .ut-score-row { padding: .45rem .2rem; }
  body .ut-score-grade { background: #fbf3df; border-radius: 999px; padding: .12rem .5rem; width: auto; min-width: 5rem; }
  body .ut-score-grade:empty { background: transparent; }

  /* ---- Project Work अभिलेख ------------------------------------------- */
  body .pw-kind { background: #fbf3df; border-color: #f0dfb4; letter-spacing: .01em; }
  body .pw-row { padding: .65rem .2rem; }
  body .pw-row:hover { background: #fdfbf6; }
  body .pw-st-btn { border-width: 1.5px; padding: .38rem .75rem; box-shadow: 0 1px 1px rgba(27, 42, 74, .04); }
  body .pw-st-btn:hover { border-color: var(--gold); background: var(--cream); }
  body .pw-score, body .pw-note { border-radius: 8px; border-color: #dfd8c8; background: #fff; }
  body .pw-score:focus, body .pw-note:focus { outline: none; border-color: var(--gold); box-shadow: var(--pro-ring); }
  body .pw-crit-row { padding: .35rem .5rem; margin-bottom: .45rem; background: #fcfaf5; border: 1px solid var(--pro-line, #e9e3d6); border-radius: 10px; }
  body #pwCritTotal { text-align: right; padding: .15rem .25rem; }
  body .pw-popt { border-radius: 12px; transition: border-color .12s ease, background .12s ease, box-shadow .12s ease; }
  body .pw-popt:hover { box-shadow: 0 6px 16px -12px rgba(27, 42, 74, .4); }
  body .pw-chip.on { box-shadow: 0 2px 8px -3px rgba(27, 42, 74, .5); }

  /* ---- स्क्रोलबार (डेस्कटप) -------------------------------------- */
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-body::-webkit-scrollbar { width: 10px; }
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav):not(.sd-body):not(.tp) .record-edit-body::-webkit-scrollbar-thumb {
    background: #d9d1bd; border-radius: 10px; border: 2px solid #fff;
  }

  @keyframes proPop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
}

@media screen and (prefers-reduced-motion: reduce) {
  :is(body.has-admin-bottom-nav, body.has-teacher-bottom-nav) .record-edit-overlay.open .record-edit-box { animation: none; }
  body .ut-test-card, body .ut-roster-row, body .pw-rec, .btn-primary, .btn-gold { transition: none; }
}
