/**
 * THIQLA Intranet – SOP Library Styles
 * Covers: layout, cards, admin CRUD, document viewer/download
 */

/* ─── Page Loader ─────────────────────────────────────────────────────────── */
#sopPageLoader {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.88);
    z-index: 9000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px; font-size: 14px; color: #64748b;
}
#sopPageLoader .spinner {
    width: 44px; height: 44px;
    border: 4px solid #e2e8f0;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: sopSpin .8s linear infinite;
}
@keyframes sopSpin { to { transform: rotate(360deg); } }

/* ─── Admin Toolbar ───────────────────────────────────────────────────────── */
#adminToolbar {
    background: linear-gradient(90deg,#1e3a8a,#2563eb);
    color: #fff; padding: 10px 20px;
    border-radius: 10px; margin-bottom: 18px;
    display: flex; align-items: center; gap: 12px; font-size: 14px;
}
#adminToolbar i { font-size: 16px; color: #93c5fd; }
#adminToolbar .toolbar-hint { opacity: .8; font-size: 12px; }
.hidden { display: none !important; }

/* ─── Stats bar ───────────────────────────────────────────────────────────── */
.sop-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.sop-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}
.sop-stat:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.sop-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sop-stat-icon i { font-size: 20px; }
.sop-stat-body { flex: 1; min-width: 0; }
.sop-stat-num {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.sop-stat-lbl {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Filter bar ──────────────────────────────────────────────────────────── */
.sop-filter-bar {
    display: flex; gap: 10px; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap;
}
.sop-search-wrap {
    flex: 1; min-width: 220px;
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 8px 14px;
    transition: border-color .2s, box-shadow .2s;
}
.sop-search-wrap:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,.1);
}
.sop-search-wrap i { color: #94a3b8; font-size: 13px; }
.sop-search-wrap input {
    border: none; outline: none; background: none;
    font-size: 13px; color: #1e293b; flex: 1;
    font-family: inherit;
}
.sop-filter-select {
    border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 9px 14px; font-size: 13px; color: #374151;
    background: #fff; outline: none; cursor: pointer;
    font-family: inherit; transition: border-color .2s;
}
.sop-filter-select:focus { border-color: #f59e0b; }

/* ─── Layout: sidebar nav + main content ─────────────────────────────────── */
.sop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px; align-items: start;
}
.sop-sidebar-nav {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 14px; padding: 14px;
    position: sticky; top: 84px;
}
.sop-sidebar-nav h4 {
    font-size: 11px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 2px 8px 8px; display: block;
}
.sop-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px;
    font-size: 13px; font-weight: 500; color: #64748b;
    cursor: pointer; transition: all .18s; margin-bottom: 2px;
    user-select: none;
}
.sop-nav-item:hover { background: #f8fafc; color: #1e293b; }
.sop-nav-item.active { background: #fffbeb; color: #b45309; font-weight: 700; }
.sop-nav-item i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.sop-nav-count {
    margin-left: auto; font-size: 11px; font-weight: 700;
    background: #f1f5f9; color: #64748b;
    padding: 1px 8px; border-radius: 20px;
}
.sop-nav-item.active .sop-nav-count { background: #fef3c7; color: #b45309; }
.sop-divider { height: 1px; background: #f1f5f9; margin: 10px 0; }

/* Admin add-division button in sidebar */
.sop-nav-add-divisi {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 9px;
    font-size: 12px; font-weight: 600; color: #2563eb;
    cursor: pointer; border: 1.5px dashed #93c5fd;
    background: #f0f9ff; transition: all .18s;
    margin-top: 6px;
}
.sop-nav-add-divisi:hover { background: #dbeafe; border-color: #2563eb; }

/* Tombol "Kelola Divisi" di admin toolbar */
.btn-manage-divisi {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff; border-radius: 9px;
    padding: 7px 16px; font-size: 13px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 7px;
    transition: background .2s; white-space: nowrap; flex-shrink: 0;
}
.btn-manage-divisi:hover { background: rgba(255,255,255,.3); }

/* ─── Section Header ──────────────────────────────────────────────────────── */
.sop-section { margin-bottom: 32px; }
.sop-section-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 14px 20px; border-radius: 12px;
    margin-bottom: 16px; color: #fff;
}
.sop-section-header-left { display: flex; align-items: center; gap: 12px; }
.sop-section-header i { font-size: 20px; flex-shrink: 0; }
.sop-section-header h3 { font-size: 15px; font-weight: 800; margin: 0 0 2px; }
.sop-section-header p { font-size: 12px; opacity: .8; margin: 0; }
.sop-section-admin-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff; border-radius: 8px;
    padding: 6px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: background .2s; white-space: nowrap; flex-shrink: 0;
}
.sop-section-admin-btn:hover { background: rgba(255,255,255,.3); }

/* ─── SOP Grid & Cards ────────────────────────────────────────────────────── */
.sop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.sop-card {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 12px; overflow: hidden;
    transition: all .2s; cursor: pointer;
    position: relative;
}
.sop-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.09);
    transform: translateY(-2px);
}
.sop-card.inactive { opacity: .55; }
.sop-card-accent { height: 4px; }
.sop-card-body { padding: 15px; }
.sop-card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.sop-doc-icon {
    width: 40px; height: 40px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.sop-card-info { flex: 1; min-width: 0; }
.sop-card-info h4 {
    font-size: 13px; font-weight: 700; color: #1e293b;
    margin: 0 0 3px; line-height: 1.4;
}
.sop-card-code { font-size: 10.5px; color: #94a3b8; font-family: monospace; }
.sop-card-desc {
    font-size: 12px; color: #64748b; line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.sop-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.sop-tag {
    font-size: 10.5px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
    background: #f1f5f9; color: #475569;
}
.sop-tag-status-aktif  { background: #dcfce7; color: #16a34a; }
.sop-tag-status-review { background: #fef9c3; color: #b45309; }
.sop-tag-status-draft  { background: #f1f5f9; color: #64748b; }
.sop-tag-status-expired{ background: #fee2e2; color: #dc2626; }

/* Card footer */
.sop-card-footer {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 9px 15px;
    background: #f8fafc; border-top: 1px solid #f1f5f9;
}
.sop-card-meta { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 4px; }
.sop-version {
    font-size: 10.5px; font-weight: 700;
    background: #eff6ff; color: #2563eb;
    padding: 2px 8px; border-radius: 20px;
}

/* ─── Card Action Buttons (admin) ─────────────────────────────────────────── */
.sop-card-actions {
    position: absolute; top: 8px; right: 8px;
    display: flex; gap: 4px;
    opacity: 0; transition: opacity .2s;
}
.sop-card:hover .sop-card-actions { opacity: 1; }
.sop-btn-edit, .sop-btn-del {
    border: none; border-radius: 7px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 12px; transition: all .18s;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.sop-btn-edit { background: #dbeafe; color: #2563eb; }
.sop-btn-edit:hover { background: #2563eb; color: #fff; }
.sop-btn-del  { background: #fee2e2; color: #dc2626; }
.sop-btn-del:hover  { background: #dc2626; color: #fff; }

/* ─── Add SOP card (admin) ────────────────────────────────────────────────── */
.sop-add-card {
    border: 2px dashed #fdba74; border-radius: 12px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 28px 16px;
    color: #f59e0b; font-size: 13px; font-weight: 600;
    cursor: pointer; background: #fffbeb;
    transition: all .2s; min-height: 120px;
}
.sop-add-card:hover { background: #fef3c7; border-color: #f59e0b; }
.sop-add-card i { font-size: 26px; }

/* ─── Document Viewer Panel ───────────────────────────────────────────────── */
.sop-doc-panel {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9200;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: sopFadeIn .2s ease;
}
.sop-doc-modal {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 820px;
    max-height: 92vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
    animation: sopSlideUp .25s ease;
}
@keyframes sopFadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes sopSlideUp { from { transform:translateY(30px);opacity:0; } to { transform:translateY(0);opacity:1; } }

.sop-doc-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.sop-doc-header-top {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px;
}
.sop-doc-header-info { flex: 1; }
.sop-doc-header-info .doc-code {
    font-size: 11px; font-family: monospace;
    color: #94a3b8; margin-bottom: 4px; display: block;
}
.sop-doc-header-info h3 {
    font-size: 16px; font-weight: 800;
    color: #1e293b; margin: 0 0 8px; line-height: 1.35;
}
.sop-doc-meta-row {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.sop-doc-meta-row span {
    font-size: 12px; color: #64748b;
    display: flex; align-items: center; gap: 4px;
}
.sop-doc-close {
    background: #fee2e2; border: none; border-radius: 8px;
    width: 34px; height: 34px; color: #dc2626; font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background .18s;
}
.sop-doc-close:hover { background: #dc2626; color: #fff; }

/* Doc action buttons */
.sop-doc-actions {
    display: flex; gap: 8px; padding: 12px 22px;
    border-bottom: 1px solid #e2e8f0; background: #fff;
    flex-wrap: wrap;
}
.sop-doc-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 9px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: none; transition: all .18s; text-decoration: none;
}
.sop-doc-btn-view {
    background: #eff6ff; color: #2563eb;
}
.sop-doc-btn-view:hover { background: #2563eb; color: #fff; }
.sop-doc-btn-download {
    background: #f0fdf4; color: #16a34a;
}
.sop-doc-btn-download:hover { background: #16a34a; color: #fff; }
.sop-doc-btn-external {
    background: #fdf4ff; color: #9333ea;
}
.sop-doc-btn-external:hover { background: #9333ea; color: #fff; }
.sop-doc-btn-nofile {
    background: #f1f5f9; color: #94a3b8; cursor: default;
}

/* iframe viewer area */
.sop-doc-viewer {
    flex: 1; overflow: hidden;
    display: flex; flex-direction: column;
}
.sop-doc-iframe-wrap {
    flex: 1; position: relative;
    background: #f1f5f9;
}
.sop-doc-iframe-wrap iframe {
    width: 100%; height: 100%;
    min-height: 480px;
    border: none;
}
.sop-doc-viewer-placeholder {
    flex: 1; display: flex;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px; color: #94a3b8; padding: 40px;
    text-align: center;
}
.sop-doc-viewer-placeholder i { font-size: 52px; }
.sop-doc-viewer-placeholder h4 { font-size: 15px; font-weight: 700; color: #475569; margin: 0; }
.sop-doc-viewer-placeholder p { font-size: 13px; margin: 0; max-width: 380px; line-height: 1.6; }
.sop-doc-description-box {
    padding: 20px 22px;
    flex: 1; overflow-y: auto;
}
.sop-doc-description-box h5 {
    font-size: 13px; font-weight: 700; color: #374151;
    margin: 0 0 8px; display: flex; align-items: center; gap: 6px;
}
.sop-doc-description-box p {
    font-size: 13px; color: #64748b; line-height: 1.7; margin: 0 0 16px;
}
.sop-doc-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 16px;
}
.sop-doc-detail-item {
    background: #f8fafc; border-radius: 8px; padding: 10px 14px;
}
.sop-doc-detail-item label {
    font-size: 11px; font-weight: 600; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .5px;
    display: block; margin-bottom: 3px;
}
.sop-doc-detail-item span { font-size: 13px; font-weight: 600; color: #1e293b; }
.sop-doc-tags-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── Admin CRUD Modal ────────────────────────────────────────────────────── */
.sop-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 9300;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: sopFadeIn .2s ease;
}
.sop-modal {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 620px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.26);
    animation: sopSlideUp .25s ease;
}
.sop-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fafc;
}
.sop-modal-header h3 { font-size: 15px; font-weight: 700; margin: 0; color: #1e293b; }
.sop-modal-close {
    background: #fee2e2; border: none; border-radius: 8px;
    width: 32px; height: 32px; color: #dc2626; font-size: 15px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .18s;
}
.sop-modal-close:hover { background: #dc2626; color: #fff; }
.sop-modal-body {
    flex: 1; overflow-y: auto;
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 13px;
}
.sop-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex; justify-content: flex-end; gap: 10px;
    background: #f8fafc;
}

/* Form fields */
.sop-field { display: flex; flex-direction: column; gap: 5px; }
.sop-field label { font-size: 12.5px; font-weight: 600; color: #374151; }
.sop-field .req { color: #ef4444; }
.sop-field input[type="text"],
.sop-field input[type="url"],
.sop-field select,
.sop-field textarea {
    border: 1px solid #d1d5db; border-radius: 8px;
    padding: 8px 12px; font-size: 13px; color: #1e293b;
    outline: none; font-family: inherit; width: 100%; box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.sop-field input:focus, .sop-field select:focus, .sop-field textarea:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245,158,11,.12);
}
.sop-field textarea { resize: vertical; min-height: 72px; }
.sop-field .field-hint { font-size: 11.5px; color: #94a3b8; }
.sop-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sop-field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* URL input with icon */
.sop-url-wrap { position: relative; }
.sop-url-wrap i {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; font-size: 12px; pointer-events: none;
}
.sop-url-wrap input { padding-left: 32px; }

/* Toggle */
.sop-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 10px 14px; cursor: pointer;
}
.sop-toggle-row label { font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; }
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: #cbd5e1; border-radius: 24px;
    cursor: pointer; transition: background .3s;
}
.toggle-slider:before {
    content: ''; position: absolute;
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%;
    transition: transform .3s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: #f59e0b; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

/* Color picker field */
.sop-color-row { display: flex; gap: 8px; align-items: center; }
.sop-color-row input[type="color"] {
    width: 42px; height: 38px; border: 1px solid #d1d5db;
    border-radius: 8px; padding: 2px; cursor: pointer; flex-shrink: 0;
}
.sop-color-row input[type="text"] { flex: 1; }

/* Modal buttons */
.btn-sop-save {
    background: linear-gradient(135deg,#f59e0b,#d97706);
    color: #fff; border: none; border-radius: 10px;
    padding: 10px 24px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: opacity .2s;
}
.btn-sop-save:hover { opacity: .88; }
.btn-sop-save:disabled { opacity: .5; cursor: not-allowed; }
.btn-sop-cancel {
    background: #f1f5f9; color: #64748b; border: none;
    border-radius: 10px; padding: 10px 20px;
    font-size: 14px; cursor: pointer; transition: background .2s;
}
.btn-sop-cancel:hover { background: #e2e8f0; }

/* ─── Delete confirm modal ────────────────────────────────────────────────── */
.sop-delete-content { text-align: center; padding: 6px 0; }
.sop-delete-icon {
    width: 58px; height: 58px; background: #fee2e2;
    border-radius: 50%; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #dc2626;
}
.sop-delete-content h4 { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: #1e293b; }
.sop-delete-content p  { font-size: 13px; color: #64748b; margin: 0 0 4px; }
.sop-delete-name {
    display: inline-block; background: #fee2e2; color: #dc2626;
    font-weight: 600; padding: 3px 12px; border-radius: 20px;
    font-size: 13px; margin-top: 6px;
}
.btn-sop-del-confirm {
    background: linear-gradient(135deg,#dc2626,#b91c1c);
    color: #fff; border: none; border-radius: 10px;
    padding: 10px 24px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: opacity .2s;
}
.btn-sop-del-confirm:hover { opacity: .88; }
.btn-sop-del-confirm:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
#sopToast {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
    background: #1e293b; color: #fff; padding: 12px 20px;
    border-radius: 10px; display: none; align-items: center; gap: 10px;
    font-size: 14px; box-shadow: 0 4px 24px rgba(0,0,0,.3);
    animation: sopSlideInToast .3s ease;
}
@keyframes sopSlideInToast {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Empty / no-result state ─────────────────────────────────────────────── */
.sop-empty {
    text-align: center; padding: 60px 20px;
    color: #94a3b8; grid-column: 1 / -1;
}
.sop-empty i { font-size: 48px; display: block; margin-bottom: 12px; }
.sop-empty p  { font-size: 14px; margin: 0; }

/* ─── No-result full-page ─────────────────────────────────────────────────── */
#sopNoResult {
    text-align: center; padding: 60px 20px; display: none;
}
#sopNoResult i { font-size: 48px; color: #cbd5e1; }
#sopNoResult p { color: #94a3b8; margin-top: 10px; font-size: 14px; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sop-layout { grid-template-columns: 1fr; }
    .sop-sidebar-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .sop-sidebar-nav h4, .sop-divider { display: none; }
    .sop-nav-item { padding: 7px 10px; font-size: 12px; }
}
@media (max-width: 600px) {
    .sop-grid { grid-template-columns: 1fr; }
    .sop-doc-detail-grid { grid-template-columns: 1fr; }
    .sop-field-row, .sop-field-row-3 { grid-template-columns: 1fr; }
    .sop-stats { grid-template-columns: 1fr; gap: 10px; }
    .sop-stat { padding: 14px 16px; gap: 12px; }
    .sop-stat-icon { width: 42px; height: 42px; }
    .sop-stat-icon i { font-size: 18px; }
    .sop-stat-num { font-size: 24px; }
    .sop-modal { max-height: 96vh; }
}

/* ─── Section header: grup tombol admin ──────────────────────────────────── */
.sop-section-admin-group {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.sop-section-edit-divisi-btn {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.3);
    color: rgba(255,255,255,.9); border-radius: 8px;
    padding: 6px 12px; font-size: 11.5px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 5px;
    transition: background .2s; white-space: nowrap;
}
.sop-section-edit-divisi-btn:hover { background: rgba(255,255,255,.25); color: #fff; }
.sop-section-edit-divisi-btn i { font-size: 10px; }

/* ─── Divisi Manager: daftar list ────────────────────────────────────────── */
.divisi-list { display: flex; flex-direction: column; gap: 8px; }
.divisi-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 10px 14px; gap: 10px;
    transition: box-shadow .18s;
}
.divisi-row:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.divisi-row-left { display: flex; align-items: center; gap: 12px; }
.divisi-row-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.divisi-row-label { font-size: 14px; font-weight: 700; color: #1e293b; }
.divisi-row-key   { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.divisi-row-key code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; }
.divisi-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.divisi-status-badge {
    font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 20px;
}
.divisi-status-badge.active   { background: #dcfce7; color: #16a34a; }
.divisi-status-badge.inactive { background: #fee2e2; color: #dc2626; }
.btn-divisi-edit {
    background: #dbeafe; color: #2563eb; border: none; border-radius: 7px;
    padding: 5px 14px; font-size: 12px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 5px;
    transition: background .18s, color .18s;
}
.btn-divisi-edit:hover { background: #2563eb; color: #fff; }

.btn-divisi-delete {
    background: #fee2e2; color: #dc2626; border: none; border-radius: 7px;
    padding: 5px 10px; font-size: 12px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 4px;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}
.btn-divisi-delete:hover { background: #dc2626; color: #fff; }

/* Badge jumlah SOP di baris divisi */
.divisi-row-sop-count {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
}
.divisi-row-sop-count.empty { color: #94a3b8; }

/* Warning box dalam modal hapus divisi */
.divisi-delete-warn {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    padding: 10px 14px;
    margin: 12px 0 4px;
    text-align: left;
    font-size: 13px;
    color: #92400e;
    line-height: 1.55;
}
.divisi-delete-warn i {
    color: #f59e0b;
    font-size: 14px;
    margin-top: 1px;
    flex-shrink: 0;
}
.divisi-delete-note {
    font-size: 12.5px;
    color: #94a3b8;
    margin: 10px 0 0;
    line-height: 1.5;
    text-align: center;
}

/* ─── Edit Divisi: preview bar ───────────────────────────────────────────── */
.div-preview-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: 10px; color: #fff;
    margin: 2px 0; transition: background .3s;
}
.div-preview-bar i   { font-size: 20px; }
.div-preview-bar span { font-size: 15px; font-weight: 700; }
