/* Smart Leave System CSS - Mobile-First Design v2.1 */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --success-color: #10b981;
    --success-light: #d1fae5;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-gray: #f3f4f6;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gray);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 60px;
}

/* ==================== App Header ==================== */
.app-header {
    background: var(--primary-gradient);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.app-logo {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.app-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ==================== Loading Screen ==================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 20px;
}

.loading-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content h5 {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 4px;
}

/* ==================== Error Screen ==================== */
.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 20px;
}

.error-content {
    text-align: center;
    max-width: 320px;
}

.error-icon {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 16px;
}

.error-content h4 {
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* ==================== Registration Screen ==================== */
.registration-container {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.registration-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.registration-header {
    text-align: center;
    margin-bottom: 24px;
}

.registration-icon {
    width: 72px;
    height: 72px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem;
    color: var(--primary-color);
}

.registration-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.line-profile-card {
    background: #00B900;
    color: white;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.line-profile-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.line-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.line-profile-icon {
    font-size: 1.5rem;
}

.line-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.line-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.line-name {
    font-weight: 600;
    font-size: 1rem;
}

/* ==================== Form Styles ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.9375rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-white);
    transition: all 0.2s;
    -webkit-appearance: none;
    /* Safari/Chrome เก่า */
    -moz-appearance: none;
    /* Firefox เก่า */
    appearance: none;
    /* Standard */
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control-lg,
.form-select-lg {
    padding: 16px;
    font-size: 1.125rem;
}

.form-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-submit {
    background: var(--primary-gradient);
    color: white;
    width: 100%;
    padding: 16px;
    font-size: 1.125rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-lg {
    padding: 16px 28px;
    font-size: 1.0625rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== Main Screen ==================== */
.main-container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Welcome Card */
.welcome-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.welcome-avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    overflow: hidden;
    flex-shrink: 0;
}

.welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.welcome-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.welcome-name {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-dark);
}

.employee-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.quick-action-btn {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.quick-action-btn span {
    font-size: 0.875rem;
    font-weight: 600;
}

.quick-action-btn:active {
    transform: scale(0.98);
    background: var(--bg-gray);
}

/* Section Card */
.section-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-gray);
}

.section-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.section-icon.history {
    background: var(--warning-light);
    color: var(--warning-color);
}

.section-header h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

/* Date Range */
.date-range-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.date-input {
    flex: 1;
    min-width: 120px;
}

.date-input .form-label {
    font-size: 0.875rem;
    white-space: nowrap;
}

.date-input .form-control,
.date-input .form-select {
    font-size: 0.9375rem;
}

.date-separator {
    padding-bottom: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Stack vertically on very small screens */
@media (max-width: 480px) {
    .date-range-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .date-input {
        flex: 1 1 45%;
        min-width: 45%;
    }

    .date-separator {
        display: none;
    }

    .date-input .form-label i {
        display: none;
    }
}

/* Leave Days Display */
.leave-days-display {
    background: var(--primary-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.days-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.days-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.days-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.days-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
}

.days-unit {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Attachment Buttons */
.attachment-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.attachment-btn {
    background: var(--bg-gray);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.attachment-btn i {
    font-size: 1.5rem;
}

.attachment-btn span {
    font-size: 0.875rem;
    font-weight: 600;
}

.attachment-btn:active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.optional-badge {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-light);
    background: var(--bg-gray);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 8px;
}

.file-preview {
    margin-top: 12px;
}

.file-preview img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.leave-item {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 4px solid var(--border-color);
}

.leave-item-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.leave-item-clickable:hover {
    background: #e5e7eb;
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.leave-item-clickable:active {
    transform: translateX(2px);
}

.leave-item.pending {
    border-left-color: var(--warning-color);
}

.leave-item.approved {
    border-left-color: var(--success-color);
}

.leave-item.rejected {
    border-left-color: var(--danger-color);
}

.leave-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.leave-status-pending {
    background: var(--warning-light);
    color: #92400e;
}

.leave-status-approved {
    background: var(--success-light);
    color: #065f46;
}

.leave-status-rejected {
    background: var(--danger-light);
    color: #991b1b;
}

.leave-status-cancelled {
    background: #f3f4f6;
    color: #6b7280;
    text-decoration: line-through;
}

/* ==================== Footer ==================== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    z-index: 100;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-divider {
    opacity: 0.3;
}

.app-name {
    font-weight: 600;
    color: var(--primary-color);
}

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 16px;
    right: 16px;
    z-index: 9999;
}

.toast {
    border-radius: var(--radius-md) !important;
}

/* ==================== Utilities ==================== */
.d-none {
    display: none !important;
}

.d-flex {
    display: flex;
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.me-1 {
    margin-right: 0.25rem;
}

.me-2 {
    margin-right: 0.5rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.gap-2 {
    gap: 0.5rem;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.justify-content-between {
    justify-content: space-between;
}

.small {
    font-size: 0.8125rem;
}

/* ==================== Safe Area ==================== */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(16px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .app-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* ==================== Tablet & Desktop ==================== */
@media (min-width: 768px) {
    .app-header {
        padding: 20px 24px;
    }

    .header-content {
        max-width: 800px;
    }

    .app-title h1 {
        font-size: 1.5rem;
    }

    .main-container {
        max-width: 700px;
        padding: 24px;
    }

    .registration-card {
        padding: 32px;
    }

    .section-card {
        padding: 24px;
    }

    .btn-primary:hover,
    .btn-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    }

    .quick-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .leave-item:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

/* ==================== Error Modal ==================== */
.error-modal-content {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.error-modal-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: none;
}

.error-modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 12px;
}

.error-modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.error-message-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.error-main-message {
    color: #991b1b;
    font-weight: 500;
    margin: 0;
    text-align: center;
}

.error-details-box {
    background: var(--bg-gray);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
}

.error-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.error-detail-row:last-child {
    border-bottom: none;
}

.error-detail-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.error-detail-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.error-ref-code {
    font-family: monospace;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.error-help-text {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    text-align: center;
    font-size: 0.875rem;
    color: #92400e;
    font-weight: 500;
}

.error-help-text i {
    font-size: 1rem;
}

#errorModal .modal-footer {
    border: none;
    padding: 16px 20px 20px;
}

#errorModal .modal-body {
    padding: 20px;
}

/* Flatpickr styles moved to calendar.css */

/* ===================================================================
   Confirm Leave Modal Styles
   =================================================================== */
.confirm-leave-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
}

.confirm-item.highlight {
    background: var(--primary-light);
    border: 1px solid var(--primary-color);
}

.confirm-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.confirm-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.confirm-value.text-wrap {
    word-break: break-word;
    white-space: pre-wrap;
}

#confirmLeaveModal .modal-header {
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

#confirmLeaveModal .modal-content {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

#confirmLeaveModal .modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px;
    gap: 12px;
}

#confirmLeaveModal .modal-footer .btn {
    flex: 1;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

#confirmLeaveModal .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-muted);
}

#confirmLeaveModal .btn-outline-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--text-muted);
    color: var(--text-dark);
}

/* ===================================================================
   Leave Detail Modal - Compact Layout
   =================================================================== */
#leaveDetailModal .modal-content {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

#leaveDetailModal .modal-header {
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 12px 16px;
}

#leaveDetailModal .modal-header .modal-title {
    font-size: 1rem;
}

#leaveDetailModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

#leaveDetailModal .modal-footer {
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.detail-card {
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.detail-card.border-danger {
    border-left: 3px solid var(--danger-color);
}

.detail-card small {
    font-size: 0.75rem;
}

.detail-card .fw-semibold {
    font-size: 0.9rem;
}

/* ==================== Leave Entitlement Card ==================== */
.entitlement-info-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: var(--radius-md);
    border: 1px solid #93c5fd;
    overflow: hidden;
    margin-bottom: 20px;
}

.entitlement-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.entitlement-body {
    padding: 16px;
}

.entitlement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #93c5fd;
}

.entitlement-row:last-of-type {
    border-bottom: none;
}

.entitlement-row.highlight {
    background: rgba(59, 130, 246, 0.15);
    margin: 8px -16px 0;
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-bottom: none;
}

.entitlement-label {
    font-size: 0.875rem;
    color: var(--text-dark);
}

.entitlement-value {
    font-weight: 700;
    font-size: 1rem;
}

.entitlement-value::after {
    content: ' วัน';
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.entitlement-expire {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #93c5fd;
}

/* Loading state for entitlement */
.entitlement-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.entitlement-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.entitlement-error .entitlement-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ==================== Overlap Warning ==================== */
.overlap-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    animation: fadeInWarning 0.3s ease-out;
}

@keyframes fadeInWarning {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlap-warning-header {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #92400e;
    font-size: 0.9375rem;
    margin-bottom: 8px;
}

.overlap-warning-header i {
    color: #f59e0b;
    font-size: 1.125rem;
}

.overlap-warning-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.overlap-warning-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: #78350f;
}

.overlap-warning-item i {
    font-size: 0.75rem;
    color: #d97706;
}

.overlap-warning-item .overlap-date {
    font-weight: 600;
    min-width: 80px;
}

.overlap-warning-item .overlap-reason {
    flex: 1;
}

.overlap-warning-item .overlap-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.overlap-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.overlap-status-approved {
    background: #d1fae5;
    color: #065f46;
}