/* Custom CSS for COBR System */

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Sidebar Styles */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(0);
    transition: all 0.3s ease;
}

/* Sidebar collapsed state */
.sidebar-collapsed .sidebar {
    width: 80px;
    transition: all 0.3s ease;
}

.sidebar-collapsed .main-content,
.sidebar-collapsed .navbar {
    margin-left: 80px;
    transition: all 0.3s ease;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    margin: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
    width: calc(100% - 250px);
    overflow-x: hidden;
    transition: all 0.3s ease;
}

.main-content .container-fluid {
    padding: 0;
    max-width: 100%;
}

.main-content .row {
    margin: 0;
}

.main-content .row > * {
    padding: 12px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 24px;
    background: white;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

/* Fix for overlapping cards */
.row .col-xl-3,
.row .col-md-6,
.row .col-lg-6 {
    padding: 8px;
}

/* Special case for stat cards to be more compact */
.dashboard-section .col-xl-3,
.dashboard-section .col-md-6 {
    padding: 4px;
}

/* Ensure proper spacing in dashboard */
.dashboard-section {
    margin-bottom: 32px;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
}

/* Form Styles */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 12px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.table tbody td {
    padding: 10px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Compact table for admin pages */
.table-compact {
    font-size: 0.8rem;
}

.table-compact thead th {
    padding: 8px 6px;
    font-size: 0.75rem;
}

.table-compact tbody td {
    padding: 8px 6px;
    font-size: 0.8rem;
}

/* Button group in tables */
.table .btn-group-sm .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Badge styles in tables */
.table .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* Responsive table improvements */
@media (max-width: 1200px) {
    .table-compact {
        font-size: 0.75rem;
    }
    
    .table-compact thead th {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    .table-compact tbody td {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.7rem;
    }
    
    .table-compact thead th,
    .table-compact tbody td {
        padding: 4px 2px;
        font-size: 0.7rem;
    }
    
    .table .btn-group-sm .btn {
        padding: 2px 4px;
        font-size: 0.7rem;
    }
    
    .table .badge {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background-color: #d1f2eb;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

/* Badge Styles */
.badge {
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 500;
}

/* Status Badge Colors */
.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
}

/* Dashboard Stats */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card .stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 15px;
}

.stats-card.primary .stats-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-card.success .stats-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stats-card.warning .stats-icon {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.stats-card.danger .stats-icon {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

/* Dashboard Stats Cards */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 70px;
}

.stat-card .card-body {
    padding: 8px !important;
}

.stat-card.gradient-success {
    background: linear-gradient(135deg, #06ffa5 0%, #00d084 100%);
}

.stat-card.gradient-warning {
    background: linear-gradient(135deg, #ffbe0b 0%, #ff9500 100%);
}

.stat-card.gradient-danger {
    background: linear-gradient(135deg, #ff006e 0%, #ff4458 100%);
}

.stat-card.gradient-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card .stat-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    opacity: 0.3;
    color: white;
}

.stat-card .stat-number {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
}

.stat-card .stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Profile Picture */
.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

/* Loading Spinner */
.spinner-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Desktop Layout */
@media (min-width: 769px) {
    /* Only apply margin if sidebar exists and not collapsed */
    body.has-sidebar .main-content:not(.expanded) {
        margin-left: 250px; /* เท่าความกว้าง sidebar */
        padding: 20px 30px;
        max-width: calc(100% - 250px);
        min-height: 100vh;
    }
    
    /* When sidebar is collapsed */
    body.has-sidebar .main-content.expanded {
        margin-left: 0;
        padding: 20px 40px;
        max-width: 1200px;
        width: 100%;
        margin-right: auto;
    }
    
    /* Default: center content (when no sidebar) */
    body:not(.has-sidebar) .main-content {
        margin-left: 0;
        max-width: 1200px;
        width: 100%;
        padding: 20px 40px;
        margin-right: auto;
        margin-left: auto;
    }
    
    /* Fix sidebar positioning */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(0);
    }
    
    /* Ensure content doesn't overlap with sidebar */
    body.has-sidebar {
        padding-left: 0;
    }
    
    /* Fix navbar positioning */
    body.has-sidebar .navbar {
        margin-left: 250px;
        width: calc(100% - 250px);
        z-index: 1001;
        transition: all 0.3s ease;
    }
    
    /* When sidebar is collapsed */
    body.has-sidebar .main-content.expanded .navbar {
        margin-left: 0;
        width: 100%;
    }
    
    /* Dashboard specific fixes */
    .main-content .row {
        margin: 0 -12px;
    }
    
    .main-content .row > * {
        padding: 12px;
    }
    
    .stat-card {
        margin-bottom: 0;
    }
    
    .dashboard-section {
        margin-bottom: 24px;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .row > [class^="col-"],
    .row > [class*=" col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .card {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-collapsed .sidebar {
        transform: translateX(-250px);
    }
    
    .sidebar-collapsed .sidebar.show {
        transform: translateX(0);
    }
    
    body.has-sidebar .navbar {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .main-content .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto;
        margin-right: auto;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .row > [class^="col-"],
    .row > [class*=" col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
    
    .stats-card {
        margin-bottom: 20px;
    }
    
    .navbar {
        padding: 10px 0;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.875rem;
    }

    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .card {
        width: 100%;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .table-responsive {
        width: 100%;
    }
    
    /* Center text content */
    .card-body {
        text-align: left;
    }
    
    .card-header {
        text-align: center;
    }
}

/* Extra Small Devices (Phones in portrait) */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .stats-card {
        padding: 15px;
    }
    
    .stats-card .stats-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .form-control {
        padding: 10px;
        font-size: 0.875rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 6px;
    }
    
    .dropdown-menu {
        min-width: 200px;
    }
    
    .dropdown-item {
        padding: 8px 15px;
        font-size: 0.875rem;
    }
    
    /* Hide some elements on very small screens */
    .d-none-xs {
        display: none !important;
    }
    
    /* Make text more readable */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    h4 { font-size: 1rem; }
    h5 { font-size: 0.9rem; }
    h6 { font-size: 0.8rem; }
}

/* Landscape orientation for phones */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar-collapsed .sidebar {
        height: 100vh;
        overflow-y: auto;
    }
    
    .main-content {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .btn,
    .navbar {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 8px 0; /* ลด padding จาก 15px เป็น 8px */
    min-height: auto; /* ลดความสูง */
}

.navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: 1.2rem; /* ลดขนาดฟอนต์จาก 1.5rem */
    display: flex;
    align-items: center;
    line-height: 1; /* ลด line height */
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: rgba(255,255,255,0.8) !important;
}

.navbar-brand i {
    margin-right: 8px; /* ลดระยะห่างไอคอน */
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 4px 10px; /* ลด padding */
    border-radius: 4px;
    font-size: 0.9rem; /* ลดขนาดฟอนต์ */
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.2);
    color: white !important;
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 2px 6px; /* ลด padding */
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* จัดการข้อมูลใน navbar ให้อยู่ในบรรทัดเดียว */
.navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-nav {
    flex-direction: row !important;
    align-items: center;
}

.navbar-nav .nav-item {
    margin: 0 2px; /* ลดระยะห่างระหว่างรายการ */
}

/* ปรับขนาด form-switch */
.form-check {
    margin: 0;
}

.form-check-input {
    width: 2.5em;
    height: 1.25em;
    margin: 0;
    cursor: pointer;
}

.form-check-label {
    margin-left: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.form-check-label i {
    font-size: 1.1rem;
}

/* ปรับ form-switch ให้ทำงานถูกต้อง */
.form-switch .form-check-input {
    background-color: var(--bs-secondary);
    border: 1px solid var(--bs-border-color);
    border-radius: 2em;
    position: relative;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-switch .form-check-input::before {
    content: "";
    height: 1em;
    width: 1em;
    border-radius: 50%;
    background-color: white;
    position: absolute;
    top: 50%;
    left: 0.125em;
    transform: translateY(-50%);
    transition: transform 0.15s ease-in-out;
}

.form-switch .form-check-input:checked::before {
    left: calc(2.5em - 1em - 0.125em);
    transform: translateY(-50%);
}

/* บังคับเฉพาะสำหรับ user_dashboard */
.user-dashboard .form-switch .form-check-input,
.user-dashboard .form-check .form-check-input {
    width: 2.5em !important;
    height: 1.25em !important;
    background-color: var(--bs-secondary) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 2em !important;
    position: relative !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.user-dashboard .form-switch .form-check-input:checked,
.user-dashboard .form-check .form-check-input:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.user-dashboard .form-switch .form-check-input::before,
.user-dashboard .form-check .form-check-input::before {
    content: "" !important;
    height: 1em !important;
    width: 1em !important;
    border-radius: 50% !important;
    background-color: white !important;
    position: absolute !important;
    top: 50% !important;
    left: 0.125em !important;
    transform: translateY(-50%) !important;
    transition: transform 0.15s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

.user-dashboard .form-switch .form-check-input:checked::before,
.user-dashboard .form-check .form-check-input:checked::before {
    left: calc(2.5em - 1em - 0.125em) !important;
    transform: translateY(-50%) !important;
}

/* บังคับเฉพาะสำหรับ theme switch ใน user dashboard */
.user-dashboard #themeSwitch {
    width: 2.5em !important;
    height: 1.25em !important;
    background-color: var(--bs-secondary) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: 2em !important;
    position: relative !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    cursor: pointer !important;
    margin: 0 !important;
}

.user-dashboard #themeSwitch:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.user-dashboard #themeSwitch::before {
    content: "" !important;
    height: 1em !important;
    width: 1em !important;
    border-radius: 50% !important;
    background-color: white !important;
    position: absolute !important;
    top: 50% !important;
    left: 0.125em !important;
    transform: translateY(-50%) !important;
    transition: transform 0.15s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

.user-dashboard #themeSwitch:checked::before {
    left: calc(2.5em - 1em - 0.125em) !important;
    transform: translateY(-50%) !important;
}

/* ปรับขนาด checkbox สำหรับหน้า login */
.login-page .form-check-input[type="checkbox"] {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--bs-primary);
    border: 3px solid var(--bs-border-color);
    border-radius: 6px;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
}

.login-page .form-check-input[type="checkbox"]:checked {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.login-page .form-check-label {
    font-size: 1.1rem;
    margin-left: 15px;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    font-weight: 500;
}

/* บังคับเพิ่มเติม */
.login-page .form-check-input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    background: transparent;
    border-radius: 6px;
    pointer-events: none;
}

/* ปรับ dropdown */
.dropdown-menu {
    margin-top: 4px;
    font-size: 0.9rem;
}

.dropdown-item {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.dropdown-item i {
    margin-right: 8px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Login Page Styles */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login Container Styles */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    max-width: 400px;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 3rem;
    color: #667eea;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: bold;
    color: white;
    width: 100%;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.login-page .alert {
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Profile Picture Styles */
.profile-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.profile-avatar i {
    font-size: 3rem;
    color: white;
}

/* Company Logo Styles */
.company-logo-thumbnail {
    max-width: 200px;
    max-height: 200px;
}

.company-logo-small {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.company-logo-placeholder {
    width: 50px;
    height: 50px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Alert Styles */
.custom-alert {
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Payroll Slip Styles */
.slip-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.slip-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.company-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.document-title {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0;
}

.employee-info {
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.salary-details {
    margin: 20px 0;
}

.salary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.salary-table th,
.salary-table td {
    border: 1px solid #333;
    padding: 8px;
    text-align: left;
}

.salary-table th {
    background: #f0f0f0;
    font-weight: bold;
}

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

.total-row {
    font-weight: bold;
    background: #f0f0f0;
}

.total-amount {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    border: 2px solid #333;
}

.slip-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.signature-area {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
}

.signature-box {
    width: 200px;
    text-align: center;
}

.signature-line {
    border-bottom: 1px solid #333;
    margin: 40px 0 5px 0;
}

@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-family: 'Sarabun', sans-serif;
        font-size: 14px;
    }
    
    .slip-container {
        border: none;
        box-shadow: none;
        padding: 20px;
    }
}

/* Modal Styles */
.modal {
    z-index: 1050;
}

.modal-dialog {
    max-width: 600px;
    margin: 1.75rem auto;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-backdrop {
    z-index: 1040;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: none !important;
    transition: none !important;
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* ป้องกันการซ่อน modal */
.modal.fade .modal-dialog {
    transform: none !important;
    transition: none !important;
}

.modal.show .modal-dialog {
    transform: none !important;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.hidden.show {
    display: block !important;
}

.print-margin {
    margin: 20px;
}
