/* =====================================================
   ระบบผ่อนผันค่าธรรมเนียมการศึกษา - Stylesheet
   คณะทรัพยากรธรรมชาติ มหาวิทยาลัยสงขลานครินทร์
   ===================================================== */

:root {
    --nr-green: #1a5c2e;
    --nr-green-light: #2d8049;
    --nr-green-pale: #e8f5ed;
    --nr-gold: #c8951a;
    --nr-gold-light: #f0b429;
    --nr-dark: #1a2332;
    --nr-gray: #6c757d;
    --nr-light: #f8faf9;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(26,92,46,0.1);
    --shadow-hover: 0 8px 30px rgba(26,92,46,0.2);
}

* { box-sizing: border-box; }

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--nr-light);
    color: var(--nr-dark);
    font-size: 16px;
    line-height: 1.7;
}

/* ===== NAVBAR ===== */
.nr-navbar {
    background: linear-gradient(135deg, var(--nr-green) 0%, var(--nr-green-light) 100%);
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    padding: 0.6rem 0;
}

.nr-navbar .brand-text {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.role-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    margin-left: 6px;
}

.btn-login {
    background: var(--nr-gold) !important;
    border-radius: 25px !important;
    padding: 6px 20px !important;
    font-weight: 600 !important;
    color: white !important;
    transition: all 0.3s;
}
.btn-login:hover { background: var(--nr-gold-light) !important; transform: translateY(-1px); }

/* ===== HERO BANNER ===== */
.hero-banner {
    background: linear-gradient(135deg, var(--nr-green) 0%, #2d8049 50%, #3a9a5c 100%);
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-banner h1 {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
}

.hero-banner .announcement-box {
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--nr-gold);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    backdrop-filter: blur(5px);
}

/* ===== CARDS ===== */
.nr-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(26,92,46,0.08);
    transition: box-shadow 0.3s;
}

.nr-card:hover { box-shadow: var(--shadow-hover); }

.nr-card-header {
    border-bottom: 2px solid var(--nr-green-pale);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.nr-card-header h4 {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    color: var(--nr-green);
    margin: 0;
}

.nr-card-header h4 i { color: var(--nr-gold); margin-right: 0.5rem; }

/* ===== BUTTONS ===== */
.btn-nr {
    background: linear-gradient(135deg, var(--nr-green), var(--nr-green-light));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}
.btn-nr:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(26,92,46,0.3); color: white; }

.btn-gold {
    background: linear-gradient(135deg, var(--nr-gold), var(--nr-gold-light));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(200,149,26,0.3); color: white; }

/* ===== FORMS ===== */
.form-control {
    border-radius: 8px;
    border: 1.5px solid #d0ddd4;
    padding: 0.6rem 1rem;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--nr-green-light);
    box-shadow: 0 0 0 3px rgba(45,128,73,0.15);
    outline: none;
}

label {
    font-weight: 600;
    color: #3a4a42;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.form-section {
    background: var(--nr-green-pale);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--nr-green);
}

.form-section h5 {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    color: var(--nr-green);
    margin-bottom: 1rem;
}

/* ===== STATUS BADGES ===== */
.badge {
    font-family: 'Sarabun', sans-serif;
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 20px;
}

/* ===== TIMELINE STATUS ===== */
.status-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
    position: relative;
}

.status-step::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.status-step:last-child::after { display: none; }

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dee2e6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.step-icon.done { background: var(--nr-green); }
.step-icon.current { background: var(--nr-gold); box-shadow: 0 0 0 4px rgba(200,149,26,0.2); }
.step-icon.rejected { background: #dc3545; }

.step-label {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 6px;
    color: var(--nr-gray);
    max-width: 90px;
}

/* ===== TABLES ===== */
.nr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.nr-table thead th {
    background: var(--nr-green);
    color: white;
    font-family: 'Prompt', sans-serif;
    font-weight: 500;
    padding: 12px 16px;
    font-size: 0.875rem;
}

.nr-table thead th:first-child { border-radius: var(--radius) 0 0 0; }
.nr-table thead th:last-child { border-radius: 0 var(--radius) 0 0; }

.nr-table tbody tr { transition: background 0.15s; }
.nr-table tbody tr:hover { background: var(--nr-green-pale); }

.nr-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #eef2ef;
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ===== SLOT PICKER ===== */
.slot-day-group { margin-bottom: 1.5rem; }

.slot-day-header {
    font-family: 'Prompt', sans-serif;
    font-weight: 600;
    color: var(--nr-green);
    background: var(--nr-green-pale);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.slot-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.slot-btn {
    border: 2px solid #d0ddd4;
    border-radius: 10px;
    padding: 10px 18px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Sarabun', sans-serif;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
}

.slot-btn:hover:not(.full):not(.selected) {
    border-color: var(--nr-green-light);
    background: var(--nr-green-pale);
}

.slot-btn.selected {
    border-color: var(--nr-green);
    background: var(--nr-green);
    color: white;
}

.slot-btn.full {
    background: #f8f9fa;
    color: #aaa;
    cursor: not-allowed;
    text-decoration: line-through;
}

.slot-count {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--nr-green) 0%, #1e7a3e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo h2 {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    color: var(--nr-green);
    margin-top: 0.75rem;
    font-size: 1.2rem;
}

.login-logo p { color: var(--nr-gray); font-size: 0.9rem; }

/* ===== STATS CARDS ===== */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--nr-green);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-number {
    font-family: 'Prompt', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--nr-green);
    line-height: 1;
}

.stat-label { color: var(--nr-gray); font-size: 0.875rem; margin-top: 0.5rem; }

/* ===== ALERTS ===== */
.nr-alert {
    border-radius: var(--radius);
    border: none;
    padding: 1rem 1.5rem;
}

.nr-alert-warning {
    background: #fff8e1;
    border-left: 4px solid var(--nr-gold);
    color: #7a5200;
}

/* ===== FOOTER ===== */
.nr-footer {
    background: var(--nr-dark);
    color: rgba(255,255,255,0.75);
    padding: 2rem 0;
    font-size: 0.875rem;
}

.nr-footer strong { color: white; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-banner h1 { font-size: 1.3rem; }
    .nr-card { padding: 1.25rem; }
    .status-timeline { gap: 5px; }
    .step-label { font-size: 0.6rem; }
}

/* ===== PRINT ===== */
@media print {
    .nr-navbar, .nr-footer, .btn, .no-print { display: none !important; }
    body { background: white; }
    .nr-card { box-shadow: none; border: 1px solid #ddd; }
}
