/* Global Styles */
:root {
    --primary-color: #004D93;
    --secondary-color: #F57C00;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --info-color: #2196F3;
    --light-color: #F5F5F5;
    --dark-color: #212121;
    --sidebar-width: 250px;
    --topbar-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background-color: #fafafa;
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary, #1f2937);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary, #1f2937);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: var(--text-primary, #1f2937);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control:disabled {
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-muted, #9ca3af);
    cursor: not-allowed;
}

.form-control.readonly {
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
}

.form-control.is-invalid {
    border-color: var(--danger-color, #dc2626);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select.form-control:disabled {
    opacity: 0.65;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

.form-control-plaintext {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 1rem;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

    .form-section:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .form-section h3 {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary, #1f2937);
        margin: 0 0 16px 0;
    }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
}

.required {
    color: #dc2626;
}

.invalid-feedback {
    color: var(--danger-color, #dc2626);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.validation-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 4px;
}

.text-danger {
    color: #dc3545;
    font-size: 0.875rem;
}

.text-muted {
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ALERT STYLES
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 14px;
}

.alert h3 {
    margin: 0 0 0.5rem 0;
}

.alert p {
    margin: 0 0 1rem 0;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   SPINNER STYLES
   ============================================ */

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ============================================
   INFO GRID (read-only detail fields)
   ============================================ */

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .info-item label {
        font-size: 0.75rem;
        color: var(--text-secondary, #6b7280);
    }

.info-value {
    font-weight: 500;
    color: var(--text-primary, #1f2937);
}

    .info-value.date-value {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .info-value .info-icon {
        width: 16px;
        height: 16px;
        color: var(--text-secondary, #6b7280);
    }

/* ============================================
   REMARKS
   ============================================ */

.remarks-text {
    font-size: 0.9rem;
    color: #333;
    white-space: pre-wrap;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 1rem;
}

/* Icons */
.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.icon-lg {
    width: 2rem;
    height: 2rem;
}


/* Modal/Dialog Overlay Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Detail Sections */
.detail-section {
    margin-bottom: 1.5rem;
}

    .detail-section h3 {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary, #6b7280);
        text-transform: uppercase;
        margin: 0 0 0.75rem 0;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
    }

