:root {
    --primary-color: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #4caf50;
    --secondary-color: #ff5722;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --sidebar-bg: #2e7d32;
    --sidebar-text: #fff;
    --border-color: #ddd;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.stat-icon {
    background: var(--primary-light);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Buttons */
.actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}


.btn-danger {
    background: white;
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

.btn-danger:hover {
    background: var(--error-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-container h2 {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
    font-weight: 500;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table td {
    font-weight: 400;
}

/* Login Page */
.login-page {
    background: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h2 {
    margin-bottom: 10px;
    font-weight: 500;
}

.login-header p {
    opacity: 0.9;
    font-weight: 400;
}

.login-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.login-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.sidebar-header p {
    font-weight: 400;
    opacity: 0.9;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-title {
    padding: 10px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    letter-spacing: 1px;
}

.menu-item {
    padding: 12px 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
    font-weight: 400;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255,255,255,0.1);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 250px;
}

.top-header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumb {
    font-weight: 500;
    color: var(--text-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: 500;
    color: var(--text-color);
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.content {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 500;
}

.page-header p {
    color: var(--text-light);
    font-weight: 400;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 400;
}

.alert-error {
    background: #ffebee;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-success {
    background: #e8f5e8;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .top-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .content {
        padding: 20px;
    }
}
/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.records-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
}

.records-per-page label {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.records-per-page select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Prompt', sans-serif;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.records-per-page select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.pagination-info {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 20px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.disabled {
    background: #f8f9fa;
    color: var(--text-light);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* No Data */
.no-data {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 40px !important;
}

/* Responsive สำหรับ Pagination */
@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .records-per-page {
        justify-content: center;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .pagination-btn {
        min-width: 35px;
        height: 35px;
        padding: 0 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 2px;
    }
    
    .pagination-btn {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        font-size: 0.8rem;
    }
    
    .table-controls {
        padding: 10px;
    }
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search Form */
.search-form {
    margin-bottom: 0;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input-group input {
    min-width: 300px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Prompt', sans-serif;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: #e8f5e8;
    color: var(--success-color);
}

.status-pending {
    background: #fff3e0;
    color: var(--warning-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* Confirmation Box */
.confirmation-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: #fff3e0;
    border-radius: 10px;
    margin-bottom: 20px;
}

.confirmation-icon {
    font-size: 3rem;
    color: var(--warning-color);
}

.confirmation-content h3 {
    color: var(--warning-color);
    margin-bottom: 10px;
}

.applicant-info {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.info-row {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.warning-text {
    color: var(--error-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

/* Status Message */
.status-message {
    margin-top: 5px;
    font-size: 0.8rem;
}

/* Filter Container */
.filter-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.filter-form .form-row {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls-right {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input-group {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input-group input {
        min-width: auto;
        width: 100%;
    }
    
    .confirmation-box {
        flex-direction: column;
        text-align: center;
    }
    
    .form-section {
        padding: 15px;
    }
}
/* User Info Card */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 30px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-details h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.role-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 5px;
}

.role-badge.super-admin {
    background: rgba(255, 193, 7, 0.9);
    color: #333;
}

.role-badge.area-admin {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

/* Password Form */
.password-form .form-section {
    margin-bottom: 0;
}

.form-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    font-style: normal;
}

/* Password Strength Meter */
.password-strength {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.strength-title {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.strength-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-level {
    height: 100%;
    width: 0%;
    background: #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
}

/* Security Tips */
.security-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-tips li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.security-tips li i.fa-check {
    color: #2e7d32;
    font-size: 0.9rem;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

.form-group {
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .user-info-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .user-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .user-details h3 {
        font-size: 1.3rem;
    }
}

.sidebar-menu .menu-item.active {
    background-color: white;
    color: #28a745 !important;
}

.sidebar-menu .menu-item.active i {
    color: #28a745 !important;
}

/* สไตล์พื้นฐานสำหรับเมนู */
.sidebar-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu .menu-item:hover {
    background-color: #117458;
}

.sidebar-menu .menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #fff;
}