/* ===================================================
   KEMAHASISWAAN UBHINUS — ADMIN STYLES
   =================================================== */

:root {
    --primary:       #1A237E;
    --primary-light: #3949AB;
    --primary-dark:  #0D1457;
    --danger:        #D32F2F;
    --danger-light:  #FFEBEE;
    --success:       #2E7D32;
    --success-light: #E8F5E9;
    --warning:       #F57F17;
    --warning-light: #FFF8E1;
    --white:         #FFFFFF;
    --off-white:     #F5F7FF;
    --bg:            #F0F2FA;
    --text:          #1A1A2E;
    --text-muted:    #6B7280;
    --border:        #E0E4F0;
    --sidebar-w:     256px;
    --topbar-h:      64px;
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --shadow-sm:     0 2px 8px rgba(26,35,126,0.08);
    --shadow-md:     0 6px 24px rgba(26,35,126,0.12);
    --transition:    0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
    border: none;
    font-family: inherit;
}
.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 12px rgba(26,35,126,0.3); }
.btn-outline   { background: white; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover  { border-color: var(--primary); background: var(--off-white); }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover   { background: #B71C1C; box-shadow: 0 4px 12px rgba(211,47,47,0.3); }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover  { background: #1B5E20; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon-danger { color: var(--danger); background: var(--danger-light); }
.btn-icon-danger:hover { background: #FFCDD2; }
.btn-icon-primary { color: var(--primary); background: var(--off-white); }
.btn-icon-primary:hover { background: rgba(26,35,126,0.1); }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    padding: 24px;
}
.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { width: 80px; height: auto; margin: 0 auto 16px; }
.login-header h1 { font-size: 1.2rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.login-header p { font-size: 0.875rem; color: var(--text-muted); }

.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i:first-child {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.875rem; pointer-events: none;
}
.input-icon-wrap input {
    width: 100%;
    padding: 10px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--off-white);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.input-icon-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
    background: white;
}
.toggle-pass {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 0.875rem; color: var(--text-muted);
    background: none; border: none; cursor: pointer; padding: 4px;
}
.toggle-pass:hover { color: var(--primary); }
.login-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #FFCDD2;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-login {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: background var(--transition), box-shadow var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-login:hover { background: var(--primary-light); box-shadow: 0 6px 20px rgba(26,35,126,0.3); }
.login-back { text-align: center; margin-top: 20px; font-size: 0.85rem; }
.login-back a { color: var(--primary); font-weight: 500; }
.login-back a:hover { text-decoration: underline; }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
    flex-shrink: 0;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; background: white; padding: 4px; border-radius: 6px; }
.sidebar-brand { display: flex; flex-direction: column; }
.sidebar-brand-main { font-size: 0.85rem; font-weight: 700; color: white; line-height: 1.2; }
.sidebar-brand-sub  { font-size: 0.7rem; color: rgba(255,255,255,0.45); }

.sidebar-nav { flex: 1; padding: 12px 8px; }
.sidebar-nav ul { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.65);
    transition: background var(--transition), color var(--transition);
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-link.active { background: rgba(255,255,255,0.14); color: white; font-weight: 600; }
.sidebar-footer { padding: 8px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 2px; }
.sidebar-link-secondary { color: rgba(255,255,255,0.5); }
.sidebar-link-danger { color: #EF9A9A; }
.sidebar-link-danger:hover { background: rgba(239,154,154,0.12); color: #EF9A9A; }

/* Main area */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: var(--topbar-h);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.sidebar-toggle { display: none; color: var(--text-muted); font-size: 1.1rem; padding: 8px; border-radius: var(--radius-sm); }
.sidebar-toggle:hover { background: var(--off-white); color: var(--text); }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.topbar-user i { font-size: 1.3rem; color: var(--primary-light); }
.topbar-role-badge { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.role-admin  { background: #e8eaf6; color: var(--primary); }
.role-editor { background: #e0f2f1; color: #00695C; }

/* Panels */
.panel { padding: 28px; flex: 1; }
.panel-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.panel-toolbar h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.panel-toolbar .btn { margin-left: auto; }
.panel-toolbar .editor-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.news-count-badge {
    padding: 3px 10px;
    background: var(--off-white);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ============================================================
   NEWS TABLE
   ============================================================ */
.news-table-wrap {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.news-table { width: 100%; border-collapse: collapse; }
.news-table thead tr { background: var(--off-white); border-bottom: 1px solid var(--border); }
.news-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}
.news-table td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.news-table tbody tr:last-child td { border-bottom: none; }
.news-table tbody tr:hover td { background: var(--off-white); }
.col-img { width: 80px; }
.col-title { min-width: 200px; }
.col-author, .col-date { width: 130px; }
.col-status { width: 110px; }
.col-action { width: 110px; text-align: right; }

.table-thumb {
    width: 60px; height: 42px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--off-white);
    display: block;
}
.table-thumb-placeholder {
    width: 60px; height: 42px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.5); font-size: 1rem;
}
.table-title { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.table-cat { font-size: 0.72rem; color: var(--text-muted); }
.table-author { font-size: 0.875rem; color: var(--text-muted); }
.table-date { font-size: 0.875rem; color: var(--text-muted); }
.table-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* Status Toggle */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
    width: 40px; height: 22px;
    background: var(--border);
    border-radius: 99px;
    position: relative;
    transition: background var(--transition);
}
.toggle-track::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: white;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: left var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--success); }
.toggle-switch input:checked ~ .toggle-track::after { left: calc(100% - 19px); }
.toggle-label { font-size: 0.78rem; font-weight: 600; }
.toggle-switch input:checked ~ .toggle-label { color: var(--success); }
.toggle-switch:not(:has(input:checked)) .toggle-label { color: var(--text-muted); }

.news-empty {
    padding: 56px 24px;
    text-align: center;
    color: var(--text-muted);
}
.news-empty i { font-size: 3rem; color: var(--border); margin-bottom: 12px; }
.news-empty p { font-size: 0.9rem; }
.news-empty strong { color: var(--primary); }

/* ============================================================
   EDITOR
   ============================================================ */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}
.editor-main { display: flex; flex-direction: column; gap: 20px; }
.editor-sidebar { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text);
    background: white;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.form-hint { font-size: 0.74rem; color: var(--text-muted); margin-top: 5px; }
.form-hint kbd { background: #e8eaf6; border: 1px solid #c5cae9; border-radius: 3px; padding: 0 4px; font-size: 0.7rem; font-family: monospace; }
/* Tag input */
.tag-input-wrap {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    padding: 5px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    cursor: text;
    min-height: 40px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.tag-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.tag-chips { display: contents; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: white;
    padding: 3px 8px 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.tag-chip button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    font-size: 0.55rem;
    color: white;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}
.tag-chip button:hover { background: rgba(255,255,255,0.45); }
.tag-input-wrap input[type="text"] {
    border: none !important;
    outline: none !important;
    padding: 2px 4px !important;
    font-size: 0.82rem !important;
    flex: 1;
    min-width: 100px;
    background: transparent !important;
    box-shadow: none !important;
}
.form-group .input-icon-wrap input {
    padding: 10px 40px;
    background: var(--off-white);
    font-size: 0.9rem;
}
.input-title {
    padding: 12px 16px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* Rich Text Editor */
.rte-wrapper {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.rte-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.rte-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px;
    background: var(--off-white);
    border-bottom: 1px solid var(--border);
}
.rte-group { display: flex; align-items: center; gap: 1px; }
.rte-separator { width: 1px; height: 22px; background: var(--border); margin: 0 6px; flex-shrink: 0; }
.rte-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: var(--text);
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    font-family: inherit;
}
.rte-btn:hover { background: var(--border); color: var(--primary); }
.rte-btn.active { background: var(--primary); color: white; }
.rte-select {
    height: 30px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.78rem;
    color: var(--text);
    background: white;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}
.rte-select:focus { border-color: var(--primary); }
.rte-color-label {
    position: relative;
    min-width: 30px;
    height: 30px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text);
    background: none;
    transition: background var(--transition);
    gap: 3px;
    padding: 0 5px;
}
.rte-color-label:hover { background: var(--border); }
.rte-color-label input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}

.rte-content {
    min-height: 360px;
    padding: 20px 24px;
    outline: none;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
}
.rte-content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}
.rte-content h1 { font-size: 1.8em; margin: 0.8em 0 0.4em; }
.rte-content h2 { font-size: 1.4em; margin: 0.8em 0 0.4em; }
.rte-content h3 { font-size: 1.2em; margin: 0.8em 0 0.4em; }
.rte-content h4 { font-size: 1em; margin: 0.8em 0 0.4em; }
.rte-content p { margin-bottom: 0.8em; }
.rte-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0; }
.rte-content ul, .rte-content ol { margin: 0.5em 0 0.5em 1.5em; }
.rte-content li { margin-bottom: 0.3em; }
.rte-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 8px 16px;
    margin: 1em 0;
    background: var(--off-white);
    color: var(--text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rte-content pre {
    background: #1E1E2E;
    color: #CDD6F4;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    overflow-x: auto;
    margin: 1em 0;
}

/* Editor Sidebar Cards */
.editor-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.editor-card h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.editor-card h4 i { color: var(--primary-light); }

/* Cover Upload */
.cover-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    overflow: hidden;
}
.cover-upload:hover { border-color: var(--primary); background: var(--off-white); }
.cover-placeholder {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
}
.cover-placeholder i { font-size: 2rem; color: var(--border); margin-bottom: 8px; }
.cover-placeholder p { font-size: 0.85rem; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.cover-placeholder span { font-size: 0.75rem; color: var(--text-muted); }
.cover-preview {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

/* ============================================================
   UNDER CONSTRUCTION PANEL
   ============================================================ */
.uc-panel {
    max-width: 500px;
    margin: 40px auto 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.uc-panel-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(26,35,126,0.25);
}
.uc-panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: #FFF3E0;
    color: #E65100;
    border: 1.5px solid #FFB74D;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.uc-panel h3 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.uc-panel p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }

/* ============================================================
   CONFIRM MODAL
   ============================================================ */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10,10,30,0.6);
    backdrop-filter: blur(4px);
}
.confirm-card {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.confirm-icon {
    width: 64px; height: 64px;
    background: var(--danger-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: var(--danger);
}
.confirm-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.confirm-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { padding: 10px 28px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: #1E1E2E;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    max-width: 320px;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
.toast.toast-success .toast-icon { color: #69F0AE; }
.toast.toast-error .toast-icon { color: #FF5252; }

/* ============================================================
   TRACER STUDY — PANEL KUISIONER
   ============================================================ */
.ts-sub-tabs { display: flex; gap: 4px; margin-left: auto; }
.ts-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-muted);
    background: var(--off-white);
    border: 1.5px solid var(--border);
    transition: all var(--transition); cursor: pointer;
    font-family: inherit;
}
.ts-tab:hover { color: var(--primary); border-color: var(--primary); }
.ts-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Stat Cards */
.ts-stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.ts-stat-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px;
    text-align: center; box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--primary);
}
.ts-stat-card.green { border-top-color: var(--success); }
.ts-stat-card.blue  { border-top-color: #1565C0; }
.ts-stat-card.orange{ border-top-color: var(--warning); }
.ts-stat-card.red   { border-top-color: var(--danger); }
.ts-stat-card.teal  { border-top-color: #00695C; }
.ts-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.ts-stat-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.ts-stat-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }

/* Report Grid */
.ts-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ts-report-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 18px;
    box-shadow: var(--shadow-sm);
}
.ts-full-card { grid-column: 1/-1; }
.ts-report-card h4 {
    font-size: 0.82rem; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
    margin-bottom: 14px; flex-wrap: wrap;
}
.ts-report-card h4 i { color: var(--primary-light); }
.ts-report-card h4 small { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); margin-left: auto; }

/* Mini Tables */
.ts-mini-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ts-mini-table th { background: var(--off-white); padding: 7px 10px; text-align: left; font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.ts-mini-table th:last-child { text-align: right; }
.ts-mini-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.ts-mini-table td:last-child { text-align: right; font-weight: 700; }
.ts-mini-table tbody tr:last-child td { border-bottom: none; }
.ts-mini-table .bar-cell { width: 100px; }
.ts-bar-wrap { width: 80px; height: 8px; background: var(--border); border-radius: 99px; display: inline-block; vertical-align: middle; }
.ts-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 99px; }

/* Gap Table */
.ts-gap-table-wrap { overflow-x: auto; }
.ts-gap-table { min-width: 560px; }
.ts-gap-table td.gap-pos { color: var(--danger); font-weight: 700; }
.ts-gap-table td.gap-neg { color: var(--success); font-weight: 700; }
.ts-gap-table td.gap-zero { color: var(--text-muted); }
.ts-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.ts-note i { color: var(--primary-light); flex-shrink: 0; margin-top: 1px; }

/* Data Table */
.ts-table-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ts-table-toolbar h4 { font-size: 0.82rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.ts-filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ts-search-input, .ts-filter-sel {
    height: 34px; padding: 0 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.82rem; color: var(--text); background: white;
    outline: none; font-family: inherit;
    transition: border-color var(--transition);
}
.ts-search-input { width: 200px; }
.ts-search-input:focus, .ts-filter-sel:focus { border-color: var(--primary); }
.ts-data-table-wrap { overflow-x: auto; }
.ts-data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 1000px; }
.ts-data-table th { background: var(--off-white); padding: 9px 10px; text-align: left; font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.ts-data-table td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.ts-data-table tbody tr:hover td { background: var(--off-white); }
.ts-data-table tbody tr:last-child td { border-bottom: none; }
.ts-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.ts-badge.kerja { background: #E8F5E9; color: #2E7D32; }
.ts-badge.wirausaha { background: #E3F2FD; color: #1565C0; }
.ts-badge.studi { background: #E8EAF6; color: #283593; }
.ts-badge.kerja_studi { background: #E0F7FA; color: #006064; }
.ts-badge.cari_kerja { background: #FFF3E0; color: #E65100; }
.ts-badge.tidak_aktif { background: var(--off-white); color: var(--text-muted); }
.ts-badge.iku-ya { background: #E8F5E9; color: #2E7D32; }
.ts-badge.iku-tidak { background: #FFEBEE; color: #C62828; }
.ts-badge.iku-sekitar { background: #FFF3E0; color: #E65100; }
.ts-badge.iku-na { background: var(--off-white); color: var(--text-muted); }
.ts-table-empty { text-align: center; padding: 48px; color: var(--text-muted); }
.ts-table-empty i { font-size: 2.5rem; color: var(--border); margin-bottom: 12px; }
.ts-table-empty p { font-size: 0.875rem; margin-bottom: 16px; }

/* Edit Data Panel */
.ts-edit-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.ts-edit-list-panel {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
}
.ts-edit-search { padding: 12px; border-bottom: 1px solid var(--border); }
.ts-edit-search .ts-search-input { width: 100%; }
.ts-edit-list { max-height: 600px; overflow-y: auto; }
.ts-edit-item {
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background var(--transition);
}
.ts-edit-item:hover { background: var(--off-white); }
.ts-edit-item.active { background: rgba(26,35,126,0.06); border-left: 3px solid var(--primary); }
.ts-edit-item-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.ts-edit-item-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.ts-edit-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }
.ts-edit-empty i { font-size: 2rem; display: block; margin-bottom: 8px; color: var(--border); }

.ts-edit-form-panel {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
}
.ts-edit-placeholder { padding: 64px 24px; text-align: center; color: var(--text-muted); }
.ts-edit-placeholder i { font-size: 2.5rem; color: var(--border); margin-bottom: 12px; display: block; }
.ts-edit-placeholder p { font-size: 0.875rem; }
.ts-edit-form-header { padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--off-white); }
.ts-edit-form-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ts-edit-form-meta { font-size: 0.75rem; color: var(--text-muted); }
.ts-edit-form-body { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-height: 500px; overflow-y: auto; }
.ts-edit-field { display: flex; flex-direction: column; gap: 4px; }
.ts-edit-field.full { grid-column: 1/-1; }
.ts-edit-field label { font-size: 0.75rem; font-weight: 700; color: var(--text); }
.ts-edit-field input, .ts-edit-field select, .ts-edit-field textarea {
    padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.82rem; color: var(--text); background: var(--off-white); outline: none;
    font-family: inherit; transition: border-color var(--transition);
}
.ts-edit-field input:focus, .ts-edit-field select:focus, .ts-edit-field textarea:focus { border-color: var(--primary); background: white; }
.ts-edit-form-actions { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   SORTABLE TABLE HEADERS
   ============================================================ */
.ts-data-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}
.ts-data-table th[data-sort]:hover { color: var(--primary); }
.ts-data-table th[data-sort]::after { content: ' ↕'; opacity: 0.35; font-size: 0.7em; }
.ts-data-table th.sort-asc::after  { content: ' ↑'; opacity: 1; color: var(--primary); }
.ts-data-table th.sort-desc::after { content: ' ↓'; opacity: 1; color: var(--primary); }

/* ============================================================
   EDIT FORM — CHECKBOX GROUPS
   ============================================================ */
.ts-edit-cb-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 0;
}
.ts-edit-cb {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.ts-edit-cb input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================================
   RESPONSE RATE MONITOR
   ============================================================ */
.ts-rr-add {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* ============================================================
   PENGGUNA LULUSAN PANEL
   ============================================================ */
.pl-stat-grid { grid-template-columns: repeat(4, 1fr) !important; }

.pl-rr-wrap { padding: 4px 0; }
.pl-rr-result {
    border-radius: var(--radius-md);
    padding: 16px 20px;
    border: 1.5px solid var(--border);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-width: 560px;
}
.pl-rr-result.rr-met    { border-color: #A5D6A7; background: #F1F8E9; }
.pl-rr-result.rr-not-met{ border-color: #FFCDD2; background: #FFEBEE; }
.pl-rr-row { display: flex; justify-content: space-between; font-size: 0.85rem; gap: 8px; }
.pl-rr-row span { color: var(--text-muted); }
.pl-rr-row strong { color: var(--text); }
.pl-rr-status {
    grid-column: 1/-1;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rr-met .pl-rr-status    { color: #2E7D32; }
.rr-not-met .pl-rr-status{ color: #C62828; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .editor-layout { grid-template-columns: 1fr; }
    .editor-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar {
        transform: translateX(-100%);
        width: 256px;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.2); }
    .main-wrap { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .panel { padding: 16px; }
    .panel-toolbar { gap: 10px; }
    .panel-toolbar .editor-actions { margin-left: 0; width: 100%; }
    .news-table { display: block; overflow-x: auto; }
    .col-author, .col-date { display: none; }
    .editor-sidebar { grid-template-columns: 1fr; }
    .login-card { padding: 36px 24px; }
    .topbar { padding: 0 16px; }
    .rte-toolbar { gap: 4px; }
}
