/* CSS for tentor/pengadaan_barang.php */
:root {
    --primary-blue: #2563eb;
    --primary-hover: #1d4ed8;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --amber-500: #f59e0b;
    --rose-500: #ef4444;
    --rose-600: #dc2626;
}

body {
    background-color: #f1f5f9;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--slate-800);
}

.pengadaan-page-wrapper {
    max-width: 1400px;
    margin: 30px auto 60px auto;
    padding: 0 20px;
}

/* Header Banner */
.pengadaan-header-banner {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
    color: white;
    padding: 28px 32px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-main-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-subtitle {
    margin: 6px 0 0 0;
    font-size: 0.92rem;
    opacity: 0.9;
    max-width: 750px;
    line-height: 1.5;
}

.header-tentor-badge {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.alert-content-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.btn-wa-confirm {
    background-color: #25D366;
    color: white;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.btn-wa-confirm:hover {
    background-color: #1eb956;
    transform: translateY(-1px);
}

/* Card Box */
.pengadaan-card-box {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--slate-200);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.02);
    padding: 24px;
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--slate-100);
    margin-bottom: 20px;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-bubble {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.icon-bubble.icon-bubble-teal {
    background: #f0fdfa;
    color: #0d9488;
}

.card-title-group h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--slate-900);
}

.text-hint {
    font-size: 0.85rem;
    color: var(--slate-600);
}

.btn-action-add {
    background: #f8fafc;
    color: var(--primary-blue);
    border: 1px solid #bfdbfe;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-action-add:hover {
    background: #eff6ff;
    border-color: var(--primary-blue);
}

/* Table Design matching image */
.table-responsive-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    background: white;
}

.pengadaan-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1050px;
}

.pengadaan-table th {
    background-color: #f8fafc;
    color: var(--slate-700);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 12px;
    border-bottom: 1px solid var(--slate-200);
    border-right: 1px solid #f1f5f9;
}

.pengadaan-table th:last-child {
    border-right: none;
}

.pengadaan-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f8fafc;
    vertical-align: middle;
}

.pengadaan-table td:last-child {
    border-right: none;
}

.pengadaan-row:hover {
    background-color: #fbfcfe;
}

.required-star {
    color: var(--rose-500);
    font-weight: 700;
}

/* Table Inputs matching modern aesthetic */
.form-input-table {
    width: 100%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.92rem;
    color: var(--slate-800);
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input-table:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-select-table {
    width: 100%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.92rem;
    color: var(--slate-800);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-select-table:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.input-currency-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--slate-600);
    pointer-events: none;
}

.input-currency-wrapper input {
    padding-left: 36px !important;
}

.row-total-display {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--slate-900);
    text-align: right;
    white-space: nowrap;
}

.col-number {
    text-align: center;
}

.row-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--slate-600);
    font-size: 0.82rem;
    font-weight: 700;
}

/* File Upload Button in Table */
.file-upload-cell {
    position: relative;
}

.input-file-hidden {
    display: none;
}

.btn-upload-label {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-upload-label:hover {
    background: #eff6ff;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-upload-label.file-attached {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
    border-style: solid;
}

.btn-delete-row {
    background: #fef2f2;
    color: var(--rose-600);
    border: 1px solid #fee2e2;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.88rem;
}

.btn-delete-row:hover {
    background: var(--rose-600);
    color: white;
    border-color: var(--rose-600);
    transform: scale(1.05);
}

/* Footer Table Summary */
.pengadaan-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
}

.btn-add-item-large {
    background: #f8fafc;
    color: var(--slate-700);
    border: 1px solid var(--slate-300);
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add-item-large:hover {
    background: #eff6ff;
    color: var(--primary-blue);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.footer-right-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.summary-total-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.summary-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e3a8a;
    letter-spacing: -0.02em;
}

.btn-submit-pengadaan {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s;
}

.btn-submit-pengadaan:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* History Table Styling */
.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 950px;
}

.history-table th {
    background-color: #f8fafc;
    color: var(--slate-700);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 14px;
    border-bottom: 1px solid var(--slate-200);
}

.history-table td {
    padding: 14px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.history-table tr:hover {
    background-color: #f8fafc;
}

.badge-qty {
    background: #eff6ff;
    color: var(--primary-blue);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-pending { background: #fffbeb; color: #b45309; }
.status-disetujui { background: #ecfdf5; color: #065f46; }
.status-ditolak { background: #fef2f2; color: #991b1b; }

.btn-file-badge {
    background: #f1f5f9;
    color: var(--primary-blue);
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-file-badge:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.btn-link-badge {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-link-badge:hover {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
}

.text-empty-dash {
    color: #94a3b8;
    font-weight: 700;
}

.btn-row-delete {
    color: var(--rose-600);
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    text-decoration: none !important;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.btn-row-delete:hover {
    background: var(--rose-600);
    color: white;
}

.empty-state-card {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
}

.empty-state-card i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.empty-state-card h3 {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--slate-700);
}

.empty-state-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--slate-600);
}

/* History Batch Cards */
.history-batch-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-batch-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.batch-card-header {
    background: var(--slate-50);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.batch-header-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.batch-code-tag {
    background: #e2e8f0;
    color: var(--slate-700);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.batch-date-text {
    font-size: 0.82rem;
    color: var(--slate-600);
}

.batch-item-count {
    background: #eff6ff;
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.batch-card-footer {
    background: var(--slate-50);
    border-top: 1px solid var(--slate-200);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.batch-notes-wrap {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.batch-note-label {
    font-weight: 700;
    color: var(--slate-600);
}

.batch-note-text {
    color: var(--slate-800);
}

.batch-total-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-total-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--slate-600);
}

.batch-total-amount {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e3a8a;
}

@media (max-width: 768px) {
    .pengadaan-page-wrapper {
        padding: 0 12px;
        margin-top: 15px;
    }
    .pengadaan-header-banner {
        padding: 20px;
    }
    .header-main-title {
        font-size: 1.3rem;
    }
    .pengadaan-table-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .footer-right-summary {
        flex-direction: column;
        align-items: stretch;
    }
    .summary-total-box {
        align-items: flex-start;
    }
    .btn-submit-pengadaan {
        justify-content: center;
    }
}
