/* ── Rekap Excel — Admin & Shared Styles ── */

:root {
  --rex-bg: #0f1117;
  --rex-surface: #1c1f2a;
  --rex-surface2: #252936;
  --rex-border: #2e3347;
  --rex-amber: #f5a623;
  --rex-amber-h: #f7b840;
  --rex-green: #34d399;
  --rex-red: #f87171;
  --rex-blue: #60a5fa;
  --rex-text: #e2e6f0;
  --rex-muted: #7b82a0;
  --rex-dim: #3a3f55;
  --rex-radius: 8px;
  --rex-font-mono: 'DM Mono', 'Fira Mono', 'Consolas', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Wrap ── */
.rex-wrap { max-width: 1200px; }

.rex-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rex-border);
}
.rex-logo { font-size: 36px; }
.rex-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #1e2030 !important;
    margin: 0 0 4px !important;
}
.rex-subtitle { color: #666; font-size: 14px; margin: 0; }

/* ── Notice ── */
.rex-notice {
    background: #fffbea;
    border-left: 4px solid var(--rex-amber);
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 20px;
    color: #333;
}
.rex-notice code {
    background: rgba(0,0,0,0.07);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--rex-font-mono);
    font-size: 12px;
}

/* ── Tool container ── */
.rex-tool {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--rex-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Tabs ── */
.rex-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 2px solid #e8eaed;
    background: #f8f9fa;
    padding: 0 4px;
}
.rex-tabs::-webkit-scrollbar { display: none; }

.rex-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    border: none;
    background: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.15s;
}
.rex-tab:hover { color: #333; background: rgba(0,0,0,0.04); }
.rex-tab.active {
    color: #e6920f;
    border-bottom-color: #f5a623;
    background: #fff;
    font-weight: 600;
}
.rex-tab-icon { font-size: 16px; }

/* ── Body layout ── */
.rex-body {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: 500px;
}
@media (max-width: 900px) {
    .rex-body { grid-template-columns: 1fr; }
}

.rex-left {
    border-right: 1px solid #e8eaed;
    padding: 20px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.rex-right {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Section ── */
.rex-section { margin-bottom: 18px; }
.rex-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #888;
    margin-bottom: 10px;
}

/* ── Dropzone ── */
.rex-dropzone {
    border: 2px dashed #d0d4dc;
    border-radius: 6px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: #fff;
}
.rex-dropzone:hover, .rex-dropzone.drag-over {
    border-color: #f5a623;
    background: #fffbf0;
}
.rex-dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.rex-drop-icon { font-size: 28px; margin-bottom: 8px; }
.rex-drop-title { font-weight: 600; font-size: 14px; color: #333; margin-bottom: 4px; }
.rex-drop-sub { font-size: 12px; color: #999; font-family: var(--rex-font-mono); }

/* ── File list ── */
.rex-file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.rex-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 5px;
    font-size: 12px;
    transition: border-color 0.15s;
}
.rex-file-item.done { border-color: #a8e6c8; background: #f0fdf7; }
.rex-file-item.error { border-color: #fca5a5; background: #fff5f5; }
.rex-file-icon { font-size: 16px; flex-shrink: 0; }
.rex-file-name { flex: 1; font-family: var(--rex-font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
.rex-file-size { color: #999; font-family: var(--rex-font-mono); flex-shrink: 0; }
.rex-file-rows { color: #34d399; font-family: var(--rex-font-mono); font-size: 11px; flex-shrink: 0; }
.rex-file-remove { background: none; border: none; color: #ccc; cursor: pointer; font-size: 14px; padding: 0 2px; transition: color 0.15s; flex-shrink: 0; }
.rex-file-remove:hover { color: #ef4444; }

/* ── Options ── */
.rex-options-block { display: none; }
.rex-options-block.active { display: block; }

.rex-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    margin-bottom: 8px;
    user-select: none;
}
.rex-checkbox input { margin: 0; accent-color: #f5a623; }

.rex-field-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #444;
}
.rex-field-row label { white-space: nowrap; min-width: 160px; }

.rex-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #d0d4dc;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    outline: none;
    transition: border-color 0.15s;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.rex-input:focus { border-color: #f5a623; box-shadow: 0 0 0 2px rgba(245,166,35,0.15); }
.rex-input-sm { max-width: 70px; }
.rex-field-note { font-size: 11px; color: #999; }

.rex-help {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 8px;
    line-height: 1.5;
    padding: 8px 10px;
    background: #f5f6f8;
    border-radius: 4px;
}

/* ── Buttons ── */
.rex-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: 5px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.rex-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.rex-btn:active { transform: none; }
.rex-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.rex-btn-primary { background: #f5a623; color: #fff; }
.rex-btn-primary:hover { background: #f7b840; }
.rex-btn-success { background: #10b981; color: #fff; }
.rex-btn-success:hover { background: #059669; }
.rex-btn-sm { padding: 5px 10px; font-size: 12px; background: #f0f0f0; color: #555; }
.rex-btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 14px; }

/* ── Progress ── */
.rex-progress { margin-top: 10px; }
.rex-progress-bar {
    height: 4px;
    background: #e8eaed;
    border-radius: 2px;
    overflow: hidden;
}
.rex-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5a623, #f7b840);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}
.rex-progress-label {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    font-family: var(--rex-font-mono);
}

/* ── Card ── */
.rex-card {
    border: 1px solid #e8eaed;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.rex-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e8eaed;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
.rex-badge {
    font-size: 11px;
    background: #e8eaed;
    color: #666;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: var(--rex-font-mono);
    font-weight: 400;
}
.rex-badge-green { background: #d1fae5; color: #059669; }

/* ── Table ── */
.rex-table-wrap {
    overflow: auto;
    max-height: 280px;
}
.rex-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: var(--rex-font-mono);
}
.rex-table th {
    position: sticky;
    top: 0;
    background: #f1f3f5;
    padding: 9px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    border-bottom: 1px solid #e0e2e7;
    white-space: nowrap;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.rex-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f1f3;
    color: #333;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rex-table tr:last-child td { border-bottom: none; }
.rex-table tr:hover td { background: #fafbfc; }
.rex-table-history td { font-family: var(--rex-font-mono); font-size: 12px; }

/* ── Export bar ── */
.rex-export-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #e8eaed;
    background: #f8f9fa;
}
.rex-export-note { font-size: 11px; color: #999; font-style: italic; }

/* ── Empty state ── */
.rex-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}
.rex-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.rex-empty-title { font-size: 15px; font-weight: 600; color: #aaa; margin-bottom: 6px; }
.rex-empty-sub { font-size: 13px; color: #bbb; }

/* ── Log ── */
.rex-log-panel {
    border: 1px solid #e8eaed;
    border-radius: 6px;
    overflow: hidden;
    background: #fafbfc;
}
.rex-log-title {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e8eaed;
    background: #f1f3f5;
}
.rex-log-entry {
    display: flex;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid #f0f1f3;
    font-size: 12px;
    font-family: var(--rex-font-mono);
    color: #666;
}
.rex-log-entry:last-child { border-bottom: none; }
.rex-log-entry.rex-log-success { color: #059669; }
.rex-log-entry.rex-log-error { color: #dc2626; }
.rex-log-entry.rex-log-info { color: #b45309; }
.rex-log-time { opacity: 0.5; flex-shrink: 0; }

/* ── History wrap ── */
.rex-history-wrap {
    min-height: 60px;
    overflow: auto;
}

/* ── Riwayat section ── */
.rex-card.mt { margin-top: 20px; }

/* ── Frontend wrap ── */
.rex-frontend-wrap .rex-frontend-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1e2030;
}

/* ── Spinner inside button ── */
.rex-spinner { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* ── v1.1 additions ── */

/* Operator input */
.rex-operator-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 2px solid #f5a623;
    border-radius: 6px;
    padding: 4px 12px 4px 8px;
}
.rex-operator-icon { font-size: 20px; flex-shrink: 0; }
.rex-input-operator {
    border: none !important;
    box-shadow: none !important;
    padding: 8px 4px !important;
    font-size: 14px !important;
    font-weight: 500;
    color: #222;
    background: transparent;
    flex: 1;
}
.rex-input-operator:focus { outline: none; }
.rex-input-operator::placeholder { color: #bbb; font-weight: 400; }

/* Process description banner */
.rex-process-desc {
    margin: 0;
    padding: 10px 16px;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
    font-size: 12px;
    color: #166534;
    font-family: var(--rex-font-mono);
    line-height: 1.6;
    word-break: break-word;
}

/* History table improvements */
.rex-ip {
    font-family: var(--rex-font-mono);
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    color: #475569;
}
.rex-desc {
    font-size: 12px;
    color: #444;
    max-width: 320px;
    white-space: normal !important;
    line-height: 1.5;
}
.rex-table-history th, .rex-table-history td { font-size: 12px; }

/* ── v1.2 — info cards & danger btn ── */
.rex-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #444;
}
.rex-info-card strong { color: #111; }
.rex-info-card small { color: #999; margin-left: 4px; }
.rex-info-icon { font-size: 18px; }
.rex-btn-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.rex-btn-danger:hover { background: #fecaca; }
