/* =============================================================
   Lambda Induction Manager v3.0 — induction.css
   Brand: Brown #5C2D0E  Gold #C8922A  White #ffffff
   ============================================================= */

/* ── Custom properties ───────────────────────────────────────── */
:root {
    --im-brown:  #5C2D0E;
    --im-gold:   #C8922A;
    --im-light:  #f9f5ee;
    --im-border: #ddd;
    --im-radius: 6px;
    --im-font:   system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── Layout wrapper ──────────────────────────────────────────── */
.im-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem 0;
    font-family: var(--im-font);
}
.im-wrap h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--im-brown);
}
.im-wrap h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 .75rem;
    color: #222;
}

/* ── Sections ────────────────────────────────────────────────── */
.im-section {
    background: #fff;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.im-section h3 {
    border-bottom: 2px solid var(--im-gold);
    padding-bottom: .4rem;
    margin-bottom: 1rem;
}

/* ── Form fields ─────────────────────────────────────────────── */
.im-field {
    margin-bottom: 1rem;
}
.im-field label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
    font-size: .925rem;
}
.im-field input[type="text"],
.im-field input[type="email"],
.im-field input[type="tel"],
.im-field input[type="url"],
.im-field input[type="date"],
.im-field input[type="number"],
.im-field select,
.im-field textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid #ccc;
    border-radius: var(--im-radius);
    font-size: .95rem;
    font-family: var(--im-font);
    transition: border-color .15s;
    box-sizing: border-box;
}
.im-field input:focus,
.im-field select:focus,
.im-field textarea:focus {
    outline: none;
    border-color: var(--im-brown);
    box-shadow: 0 0 0 2px rgba(92,45,14,.15);
}
.im-field textarea {
    resize: vertical;
    min-height: 80px;
}
.im-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

/* ── Hints / required ────────────────────────────────────────── */
.im-req { color: #c00; font-weight: 700; }
.im-hint, small.im-hint {
    font-size: .82rem;
    color: #888;
    display: block;
    margin-top: .2rem;
}

/* ── Radio groups ────────────────────────────────────────────── */
.im-radio-group {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: .2rem;
}
.im-radio-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: normal;
    cursor: pointer;
}

/* ── Chapter autofill chips ──────────────────────────────────── */
.im-autofill-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: -.25rem 0 .75rem;
}
.im-meta-chip {
    background: var(--im-light);
    border: 1px solid #e5ddd0;
    border-radius: 12px;
    padding: .25rem .75rem;
    font-size: .82rem;
    color: #555;
}

/* ── UM user search dropdown ─────────────────────────────────── */
.im-um-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.im-um-result-item:hover { background: var(--im-light); }
.im-um-result-item img { border-radius: 50%; object-fit: cover; }

/* ── Inductee rows ───────────────────────────────────────────── */
.im-inductee-row {
    background: var(--im-light);
    border: 1px solid #e5ddd0;
    border-radius: var(--im-radius);
    padding: 1rem 1rem .5rem;
    margin-bottom: .75rem;
}
.im-inductee-header {
    display: flex;
    align-items: center;
    margin-bottom: .75rem;
    gap: .5rem;
}
.im-inductee-header strong { font-size: .95rem; color: var(--im-brown); }
.im-inductee-header button { margin-left: auto; }

/* ── Upload zone ─────────────────────────────────────────────── */
.im-upload-zone {
    border: 2px dashed #c8b89a;
    border-radius: var(--im-radius);
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    color: #888;
    transition: background .15s, border-color .15s;
}
.im-upload-zone:hover, .im-upload-zone.im-drag-over {
    background: var(--im-light);
    border-color: var(--im-brown);
}
.im-upload-zone p { margin: 0; }

/* Uploaded file list */
#im-file-list { margin-top: .5rem; }
.im-file-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .6rem;
    background: #f0f0f0;
    border-radius: 4px;
    margin-top: .35rem;
    font-size: .85rem;
}
.im-file-item .im-file-remove {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #a00;
    font-size: .9rem;
}
.im-file-item .im-file-progress {
    height: 4px;
    background: var(--im-brown);
    width: 0;
    border-radius: 2px;
    flex: 1;
    transition: width .2s;
}

/* ── Checklist box ───────────────────────────────────────────── */
.im-checklist-box {
    background: #fefce8;
    border: 1px solid #f0e080;
    border-radius: var(--im-radius);
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.im-checklist-box ul { margin: .4rem 0 0 1.25rem; }
.im-checklist-box li { margin-bottom: .3rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.im-btn {
    display: inline-block;
    padding: .6rem 1.4rem;
    font-size: .95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--im-radius);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--im-font);
    transition: opacity .15s, box-shadow .15s;
}
.im-btn:hover { opacity: .9; }
.im-btn--primary {
    background: var(--im-brown);
    color: #fff;
}
.im-btn--secondary {
    background: var(--im-gold);
    color: #fff;
}
.im-btn--small {
    padding: .35rem .9rem;
    font-size: .85rem;
}
.im-btn--warning { background: #b45309; color: #fff; }
button.im-btn-text {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--im-brown);
    font-size: .875rem;
    text-decoration: underline;
}

/* ── Notices / alerts ────────────────────────────────────────── */
.im-notice {
    padding: .75rem 1rem;
    border-radius: var(--im-radius);
    font-size: .9rem;
    margin-top: .75rem;
}
.im-notice--info    { background: #e0f0fb; color: #0f4c75; border: 1px solid #b0d8f0; }
.im-notice--success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.im-notice--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.im-notice--warning { background: #fef9c3; color: #713f12; border: 1px solid #fde047; }

/* ── Status badges ───────────────────────────────────────────── */
.im-status-badge {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: capitalize;
}
.im-status-pending  { background: #fef3c7; color: #92400e; }
.im-status-approved { background: #d1fae5; color: #065f46; }
.im-status-rejected { background: #fee2e2; color: #7f1d1d; }

/* ── Tier badges (smaller) ───────────────────────────────────── */
.im-tier-badge {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 600;
}
.im-tier-pending  { background: #fef3c7; color: #92400e; }
.im-tier-approved { background: #d1fae5; color: #065f46; }
.im-tier-rejected { background: #fee2e2; color: #7f1d1d; }
.im-tier-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.im-tier-badges--large .im-tier-badge { font-size: .9rem; padding: .3rem .8rem; }

/* ── Application cards (my-apps / review dashboard) ─────────── */
.im-app-list { display: flex; flex-direction: column; gap: .75rem; }
.im-app-card {
    background: #fff;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    padding: 1rem 1.25rem;
}
.im-app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .4rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.im-app-card-meta {
    font-size: .85rem;
    color: #666;
    margin-bottom: .5rem;
}
.im-app-card-actions { margin-top: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.im-pipe { margin: 0 .3rem; color: #ccc; }

/* ── Application detail table ────────────────────────────────── */
.im-detail-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.im-detail-table th { text-align: left; padding: .5rem .75rem; background: var(--im-light); font-weight: 600; width: 200px; border-bottom: 1px solid var(--im-border); color: #555; white-space: nowrap; }
.im-detail-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--im-border); }

/* ── Responsive table ────────────────────────────────────────── */
.im-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.im-table th { background: var(--im-brown); color: #fff; text-align: left; padding: .5rem .75rem; }
.im-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--im-border); }
.im-table tr:nth-child(even) td { background: #fafafa; }

/* ── Audit log ───────────────────────────────────────────────── */
.im-audit-log { display: flex; flex-direction: column; gap: .6rem; }
.im-audit-entry {
    background: var(--im-light);
    border-left: 4px solid var(--im-gold);
    border-radius: 0 var(--im-radius) var(--im-radius) 0;
    padding: .6rem 1rem;
    font-size: .875rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem;
}
.im-audit-date { color: #888; font-size: .8rem; min-width: 130px; }
.im-audit-tier { background: var(--im-brown); color: #fff; font-size: .75rem; padding: .1rem .45rem; border-radius: 6px; }
.im-audit-notes { width: 100%; margin: .2rem 0 0; color: #555; font-style: italic; }

/* ── Document list ───────────────────────────────────────────── */
.im-doc-list { list-style: none; padding: 0; margin: 0; }
.im-doc-list li { margin-bottom: .35rem; font-size: .9rem; }
.im-doc-list a { color: var(--im-brown); text-decoration: none; }
.im-doc-list a:hover { text-decoration: underline; }

/* ── Dashboard stats ─────────────────────────────────────────── */
.im-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.im-stat-card {
    background: #fff;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    padding: 1.25rem 1rem;
    text-align: center;
}
.im-stat-num { font-size: 2.2rem; font-weight: 700; color: var(--im-brown); line-height: 1; }
.im-stat-label { font-size: .8rem; color: #888; margin-top: .3rem; }
.im-stat-approved .im-stat-num { color: #166534; }
.im-stat-pending  .im-stat-num { color: #b45309; }
.im-stat-rejected .im-stat-num { color: #a00; }

/* ── Admin two-column layout ─────────────────────────────────── */
.ltp-admin-two-col {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 700px) { .ltp-admin-two-col { grid-template-columns: 1fr; } }

/* ── Admin wrap overrides ────────────────────────────────────── */
.ltp-admin h1 { color: var(--im-brown); }
.ltp-admin h2 { font-size: 1.1rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .im-field-row { grid-template-columns: 1fr; }
    .im-detail-table th { width: 110px; }
}

/* ── Field validation errors ─────────────────────────────────── */
.im-field-error,
input.im-field-error,
select.im-field-error,
textarea.im-field-error {
    border-color: #dc2626 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 2px rgba(220,38,38,.15) !important;
}
.im-field-error-msg {
    display: block;
    color: #dc2626;
    font-size: .8rem;
    font-weight: 600;
    margin-top: .25rem;
}

/* ── File slot upload ────────────────────────────────────────── */
.im-file-slot {
    transition: background .15s;
}
.im-file-slot:hover { background: #eee !important; }

/* ── Tracker table ───────────────────────────────────────────── */
.im-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}
.im-table th,
.im-table td {
    padding: .45rem .7rem;
    white-space: nowrap;
}
.im-table th:first-child,
.im-table td:first-child {
    white-space: normal;
    min-width: 140px;
}

/* Tracker content area — centered, max width keeps it readable */
.im-tracker-content {
    max-width: 820px;
    margin: 0 auto;
}

/* Sector header bar in region tracker matches table width */
.im-sector-block {
    max-width: 820px;
    margin: 0 auto 1.5rem;
}
.im-sector-block .im-sector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .9rem;
    background: #5C2D0E;
    color: #fff;
    border-radius: 6px 6px 0 0;
}
.im-sector-block .im-table {
    border-top: none;
}
