/* ==============================
   ตัวแปรสีและพื้นฐาน
   ============================== */
   :root {
    --chula-blue: #1a237e;
    --chula-accent: #d32f2f;
    --chula-gold: #ffc107;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #495057;
}

/* ==============================
   พื้นฐานและ Typography
   ============================== */
body {
    font-family: 'Segoe UI', 'Sarabun', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}



/* ==============================
   Container และ Layout
   ============================== */
.form-container {
    max-width: 1300px;
    margin: 0 auto 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.section-card {
    padding: 2rem;
    border-bottom: 1px solid var(--medium-gray);
}

.section-card:last-child {
    border-bottom: none;
}

/* ==============================
   หัวข้อและ Subtitle
   ============================== */
.section-title {
    color: var(--chula-blue);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--chula-gold);
    position: relative;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 2px;
    background-color: var(--chula-accent);
}

.subsection-title {
    color: var(--chula-blue);
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: 1.2rem;
    padding-left: 15px;
    border-left: 3px solid var(--chula-accent);
}

/* ==============================
   Form Elements
   ============================== */
.required-field::after {
    content: " *";
    color: var(--chula-accent);
    font-weight: 700;
}

.form-label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--chula-blue);
    box-shadow: 0 0 0 0.25rem rgba(26, 35, 126, 0.15);
}

.form-control:read-only {
    background-color: var(--light-gray);
}

/* ==============================
   Contact Info Box
   ============================== */
.contact-info-box {
    background-color: var(--light-gray);
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 1rem;
    border-left: 4px solid var(--chula-blue);
}

.info-row {
    display: flex;
    margin-bottom: 0.8rem;
}

.info-label {
    font-weight: 600;
    color: var(--chula-blue);
    min-width: 200px;
}

.info-value {
    color: var(--dark-gray);
}

/* ==============================
   Tables
   ============================== */
.table-custom {
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    overflow: hidden;
}

.table-custom thead th {
    background-color: var(--chula-blue);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-align: center;
    vertical-align: middle;
}

.table-custom tbody td {
    padding: 0.85rem;
    vertical-align: middle;
    border-color: var(--medium-gray);
}

.table-custom tbody tr:nth-child(even) {
    background-color: var(--light-gray);
}

/* ==============================
   Text และ Icon Styles
   ============================== */
.text-danger-custom {
    color: var(--chula-accent);
    font-weight: 700;
}

.info-icon {
    color: var(--chula-blue);
    cursor: help;
    margin-left: 5px;
}

.instruction-box {
    background-color: #fff8e1;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--chula-gold);
    font-size: 0.9rem;
    color: #5d4037;
}

/* ==============================
   Buttons
   ============================== */
.btn-custom-primary {
    background-color: var(--chula-blue);
    color: white;
    font-weight: 600;
    padding: 0.6rem 2rem;
    border: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-custom-primary:hover {
    background-color: #283593;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-custom-outline {
    background-color: white;
    color: var(--chula-blue);
    font-weight: 600;
    padding: 0.6rem 2rem;
    border: 2px solid var(--chula-blue);
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-custom-outline:hover {
    background-color: var(--chula-blue);
    color: white;
}

.btn-custom-success {
    background-color: #2e7d32;
    color: white;
    font-weight: 600;
    padding: 0.6rem 2.5rem;
    border: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-custom-success:hover {
    background-color: #1b5e20;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}


/* ==============================
   Summernote Custom Styles
   ============================== */
.note-editor {
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
}

.note-editor.note-frame {
    border-color: #ced4da !important;
}

.note-toolbar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #ced4da !important;
    border-top-left-radius: 4px !important;
    border-top-right-radius: 4px !important;
    padding: 0.5rem !important;
}

.note-btn-group {
    margin-right: 0.5rem !important;
}

.note-editable {
    min-height: 150px !important;
    padding: 1rem !important;
    font-family: 'Sarabun', sans-serif !important;
    font-size: 1rem !important;
}

.note-statusbar {
    background-color: #f8f9fa !important;
    border-top: 1px solid #ced4da !important;
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

/* ==============================
   Utility classes สำหรับ Bootstrap 4.6.2
   ============================== */
.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }

.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }

.ps-3 { padding-left: 1rem !important; }
.pt-3 { padding-top: 1rem !important; }

.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.text-md-end { text-align: right !important; }

.text-primary { color: #007bff !important; }
.text-danger { color: #dc3545 !important; }
.text-muted { color: #6c757d !important; }

.fw-medium { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-bold { font-weight: 700 !important; }

.small { font-size: 0.875rem !important; }

.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }

.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid #dee2e6 !important; }
.border-secondary { border-color: #6c757d !important; }

.bg-light { background-color: #f8f9fa !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-success { background-color: #28a745 !important; }

.text-white { color: white !important; }

.btn-link {
    font-weight: 400;
    color: #007bff;
    text-decoration: none;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.p-0 { padding: 0 !important; }

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.align-middle {
    vertical-align: middle !important;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
}

/* ==============================
   Responsive Design
   ============================== */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 1.4rem;
    }

    .section-card {
        padding: 1.5rem;
    }

    .info-label {
        min-width: 150px;
    }

    .table-custom {
        font-size: 0.9rem;
    }

    .text-md-end {
        text-align: left !important;
    }
    
    .mb-md-0 {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 576px) {
    .info-row {
        flex-direction: column;
        margin-bottom: 1rem;
    }
    
    .info-label {
        min-width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .note-toolbar .note-btn-group {
        margin-bottom: 0.25rem !important;
    }
    
    .note-editable {
        font-size: 0.9rem !important;
    }
}

/* ==============================
   Additional Custom Styles
   ============================== */
.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.cursor-pointer {
    cursor: pointer;
}

/* Highlight สำหรับเซลล์เดือนในตารางแผนงาน */
.bg-warning {
    background-color: var(--chula-gold) !important;
}

/* Hover effects สำหรับตาราง */
.table-hover tbody tr:hover {
    background-color: rgba(26, 35, 126, 0.05);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--chula-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #283593;
}