/* ═══════════════════════════════════════════════════════════
   IndoGerman Ops - styles added in 1.2
   Course finder rail, application accordion, weekly routine
   planner, report cards, auth screen, credentials.
   Loads after igop.css / igop-student.css and reuses their vars.
   ═══════════════════════════════════════════════════════════ */

/* ═══════════ COURSE FINDER — LEFT RAIL ═══════════ */

.igop-finder-layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.igop-rail {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.igop-rail-inner { padding: 20px; }
.igop-rail-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 6px;
}
.igop-rail-head h2 { font-size: 1em; }
.igop-rail-block { margin-bottom: 18px; }
.igop-rail-block:last-child { margin-bottom: 0; }
.igop-rail-block .igop-label { margin-top: 0; }

.igop-chip-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.igop-fchip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; font-family: inherit; font-size: .78em; font-weight: 600;
    color: #475569; cursor: pointer; transition: .16s;
}
.igop-fchip:hover { border-color: var(--navy); color: var(--navy); }
.igop-fchip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.igop-fchip em {
    font-style: normal; font-size: .85em; opacity: .65; font-weight: 700;
}

.igop-results { min-width: 0; }
.igop-filter-toggle { display: none; }
.igop-rail-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
    z-index: 998; opacity: 0; visibility: hidden; transition: .2s;
}
.igop-rail-backdrop.is-open { opacity: 1; visibility: visible; }

.igop-course.is-requested { border-top-color: var(--ok); opacity: .85; }

@media (max-width: 900px) {
    .igop-finder-layout { grid-template-columns: 1fr; }
    .igop-filter-toggle { display: inline-flex; }
    .igop-rail {
        position: fixed; top: 0; left: 0; height: 100vh; width: 300px; max-width: 88vw;
        z-index: 999; border-radius: 0; transform: translateX(-102%);
        transition: transform .28s cubic-bezier(.4, 0, .2, 1); max-height: none;
    }
    .igop-rail.is-open { transform: translateX(0); }
}

/* ═══════════ APPLICATION ACCORDION ═══════════ */

.igop-app-finder { margin-bottom: 10px; }
.igop-app-list { display: grid; gap: 9px; }

.igop-app { padding: 0; overflow: hidden; }

.igop-app-toggle {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 14px 16px; background: none; border: none; cursor: pointer;
    font-family: inherit; text-align: left; transition: .16s;
}
.igop-app-toggle:hover { background: #f8fafc; }
.igop-app-caret {
    font-size: 1.4em; color: #94a3b8; line-height: 1; flex-shrink: 0;
    transition: transform .22s; display: inline-block;
}
.igop-app:not(.igop-app-collapsed) .igop-app-caret { transform: rotate(90deg); color: var(--navy); }

.igop-app-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.igop-app-titles strong { font-size: .92em; color: var(--ink); }
.igop-app-titles em {
    font-style: normal; font-size: .8em; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.igop-app-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.igop-flag {
    padding: 3px 8px; border-radius: 6px; font-size: .66em;
    font-weight: 800; text-transform: uppercase; letter-spacing: .3px;
}
.igop-flag-danger { background: var(--danger-bg); color: var(--danger); }
.igop-flag-warn { background: var(--warn-bg); color: var(--warn); }

.igop-app-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.igop-app-collapsed .igop-app-body { display: none; }
.igop-app-sub { padding-top: 12px; margin-bottom: 12px; }
.igop-app:not(.igop-app-collapsed) { box-shadow: 0 6px 20px rgba(15, 23, 42, .1); }

@media (max-width: 680px) {
    .igop-app-toggle { flex-wrap: wrap; }
    .igop-app-flags { width: 100%; padding-left: 25px; }
}

/* ═══════════ STUDENT LEVEL PICKER ═══════════ */

.igop-level-picker { border-left: 4px solid var(--navy); }
.igop-level-options { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.igop-level-opt {
    padding: 11px 18px; border-radius: 11px; border: 1.5px solid var(--line);
    background: #fff; font-family: inherit; font-size: .87em; font-weight: 700;
    color: #475569; cursor: pointer; transition: .16s;
}
.igop-level-opt:hover { border-color: var(--navy); color: var(--navy); }
.igop-level-opt.is-active {
    background: var(--navy); border-color: var(--navy); color: #fff;
    box-shadow: 0 4px 12px rgba(62, 73, 115, .25);
}

/* ═══════════ WEEKLY ROUTINE PLANNER (admin) ═══════════ */

.igop-routine-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.igop-routine-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.igop-week-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.igop-day-col {
    background: #fff; border-radius: var(--radius); padding: 14px;
    box-shadow: var(--shadow); border-top: 3px solid var(--navy);
}
.igop-day-col.is-empty { opacity: .6; border-top-color: var(--line); }
.igop-day-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 11px;
}
.igop-day-head h3 { font-size: .85em; text-transform: uppercase; letter-spacing: .5px; }
.igop-day-empty { text-align: center; padding: 12px 0; }

.igop-tpl {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 9px 0; border-bottom: 1px solid #f1f5f9;
}
.igop-tpl:last-child { border-bottom: none; }
.igop-tpl-check { flex-shrink: 0; padding-top: 2px; }
.igop-tpl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.igop-tpl-body strong { font-size: .82em; font-weight: 600; line-height: 1.35; word-break: break-word; }
.igop-tpl-delete { font-size: 1.2em; line-height: 1; flex-shrink: 0; text-decoration: none; }

/* ═══════════ EMPLOYEE WEEK VIEW ═══════════ */

.igop-week-summary { border-left: 4px solid var(--orange); }
.igop-week-summary-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.igop-week-score { text-align: right; display: flex; flex-direction: column; gap: 1px; }
.igop-week-score-num { font-size: 2em; font-weight: 800; line-height: 1; color: var(--ink); }

.igop-score-bar { height: 9px; background: #e9edf3; border-radius: 5px; overflow: hidden; }
.igop-score-bar i {
    display: block; height: 100%; background: var(--ok);
    border-radius: 5px; transition: width .5s;
}
.igop-score-bar i.is-bad { background: var(--danger); }
.igop-score-bar-sm { height: 6px; flex: 1; }

.igop-day-block {
    background: #fff; border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow); margin-bottom: 11px; border-left: 4px solid transparent;
}
.igop-day-block.is-today { border-left-color: var(--orange); }
.igop-day-block.is-past { opacity: .82; }
.igop-day-block-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.igop-day-block-head h3 { font-size: .98em; display: flex; align-items: center; gap: 9px; }
.igop-pill-today { background: var(--orange); color: #fff; }

.igop-wtask {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid #f1f5f9;
}
.igop-wtask:last-child { border-bottom: none; }
.igop-wtask-state {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .8em; font-weight: 800;
    background: #f1f5f9; color: #94a3b8; border: 2px solid #e2e8f0;
}
.igop-wtask.is-done .igop-wtask-state { background: var(--ok); border-color: var(--ok); color: #fff; }
.igop-wtask.is-missed .igop-wtask-state { background: var(--danger); border-color: var(--danger); color: #fff; }
.igop-wtask-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.igop-wtask-body strong { font-size: .88em; font-weight: 600; line-height: 1.35; }
.igop-wtask.is-done .igop-wtask-body strong { text-decoration: line-through; opacity: .65; }
.igop-wtask-action { flex-shrink: 0; }

.igop-report-list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.igop-report-row {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 17px; border-bottom: 1px solid var(--line);
}
.igop-report-row:last-child { border-bottom: none; }
.igop-report-week { font-size: .82em; font-weight: 700; color: var(--muted); min-width: 78px; }
.igop-report-figures {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 1px; min-width: 96px; text-align: right;
}
.igop-report-figures strong { font-size: .95em; }

@media (max-width: 680px) {
    .igop-wtask { flex-wrap: wrap; }
    .igop-wtask-action { width: 100%; padding-left: 38px; }
    .igop-wtask-action .igop-btn { width: 100%; }
    .igop-report-row { flex-wrap: wrap; gap: 8px; }
    .igop-score-bar-sm { order: 3; width: 100%; flex: none; }
}

/* ═══════════ AUTH SCREEN ═══════════ */

.igop-auth-wrap { display: flex; justify-content: center; padding: 28px 16px; }
.igop-auth-card {
    width: 100%; max-width: 470px; background: #fff;
    border-radius: 18px; box-shadow: 0 12px 40px rgba(15, 23, 42, .1); overflow: hidden;
}
.igop-auth-tabs { display: flex; background: #f8fafc; border-bottom: 1px solid var(--line); }
.igop-auth-tab {
    flex: 1; padding: 17px; border: none; background: none; cursor: pointer;
    font-family: inherit; font-size: .92em; font-weight: 700; color: var(--muted);
    transition: .18s; border-bottom: 3px solid transparent;
}
.igop-auth-tab:hover { color: var(--ink); }
.igop-auth-tab.is-active { background: #fff; color: var(--navy); border-bottom-color: var(--orange); }
.igop-auth-body { padding: 28px 26px 30px; }
.igop-auth-form { display: none; }
.igop-auth-form.is-active { display: block; animation: igopFade .25s ease; }
.igop-auth-title { font-size: 1.25em; margin-bottom: 4px; }
.igop-auth-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin: 14px 0 4px; flex-wrap: wrap;
}
.igop-auth-row .igop-check { margin: 0; }
.igop-auth-terms { margin-top: 14px; text-align: center; line-height: 1.5; }

/* ═══════════ COURSE MANAGER ═══════════ */

.igop-code {
    background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 9px;
    font-size: .78em; overflow-x: auto; margin: 10px 0; font-family: ui-monospace, Menlo, Consolas, monospace;
    white-space: pre-wrap; word-break: break-word;
}

/* ═══════════ CREDENTIALS ═══════════ */

.igop-cred {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.igop-cred:last-child { border-bottom: none; }
.igop-cred-body { flex: 1; min-width: 0; }
.igop-cred-secret {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em;
    background: #f1f5f9; padding: 3px 9px; border-radius: 6px; color: var(--ink);
}
