/* General Styles */
:root {
    --primary-color: #4b4b7a;
    --primary-color-dark: #3a3a6a;
    --secondary-color: #6c757d;
    --secondary-color-light:#acb0b3;
    --third--color:#ffcc00;
    --danger-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #343a40;
    --sidebar-bg: linear-gradient(135deg, #4b4b7a, #343a40);
    --card-bg: #ffffff;
    --card-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    --menu-btn-bg: linear-gradient(135deg, #4b4b7a, #6c757d);
    --menu-btn-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    --font-family: "Poppins", sans-serif;
    --base-font-size: 16px;
    --h1-font-size: 2rem;
    --h2-font-size: 1.75rem;
    --h3-font-size: 1.5rem;
    --h4-font-size: 1.25rem;
    --body-font-size: 1rem;
    --small-font-size: 0.875rem;
}


body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--body-font-size);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background:linear-gradient(346deg, rgb(225 225 234 / 74%) 0%, rgba(246, 246, 247, 1) 51%) !important;
}

/* Responsive Font Sizes */
@media (max-width: 1200px) {
    :root {
        --h1-font-size: 1.75rem;
        --h2-font-size: 1.5rem;
        --h3-font-size: 1.25rem;
        --h4-font-size: 1.125rem;
        --body-font-size: 0.9375rem;
    }
}

@media (max-width: 992px) {
    :root {
        --h1-font-size: 1.5rem;
        --h2-font-size: 1.25rem;
        --h3-font-size: 1.125rem;
        --h4-font-size: 1rem;
        --body-font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    :root {
        --h1-font-size: 1.25rem;
        --h2-font-size: 1.125rem;
        --h3-font-size: 1rem;
        --h4-font-size: 0.875rem;
        --body-font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    :root {
        --h1-font-size: 1rem;
        --h2-font-size: 0.9375rem;
        --h3-font-size: 0.875rem;
        --h4-font-size: 0.8125rem;
        --body-font-size: 0.75rem;
    }
}

/** Text control */
.text-main{
    color: var(--primary-color-dark);
}

/** button */
input[type=file]{
    height:44px;
}
/* Sidebar Styles */
.sidebar {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    z-index: 1100;
    transition: left 0.3s ease;
    font-size: var(--body-font-size);
    overflow-y: auto; /* Enable scrolling */
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar h2 {
    font-size: var(--h4-font-size);
    font-weight: 600;
    margin-bottom: 1rem;
}

.sidebar ul {
    padding-left: 0;
    list-style: none;
}

.sidebar ul li {
    font-size: var(--body-font-size);
    font-weight: 500;
    margin-bottom: 1rem;
}

.sidebar ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.sidebar ul li a:hover {
    color: #fff;
}

.close-btn {
    font-size: 1.5rem;
    background: none;
    color: #fff;
    border: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    display: none;
}

/* Overlay for Sidebar */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: display 0.3s ease;
}

.overlay.show {
    display: block;
}

/* Content Area */
.content {
    transition: margin-left 0.3s ease;
    padding: 1.5rem;
    margin-left: 250px;
    font-size: var(--body-font-size);
}

/* Menu Button */
.menu-toggle-btn {
    font-size: var(--small-font-size);
    background: var(--menu-btn-bg);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    z-index: 1100;
    position: fixed;
    top: 1rem;
    left: 1rem;
    box-shadow: var(--menu-btn-shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

/* Header Styles */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: var(--h2-font-size);
}

.content-header .search-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    font-size: var(--small-font-size);
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background-color: var(--primary-color-dark);
}
.action-btn:active {
    background-color: var(--primary-color-dark);
}
.default-btn {
    border:1px solid #e1e1e4 !important;
    padding: 0.5rem 1rem;
    font-size: var(--small-font-size);
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: #f6f6f7;
    color: var(--secondary-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    
}
.default-btn:hover{
    color: var(--primary-color-dark);
    border:1px solid var(--primary-color-dark) !important;
    text-decoration: none !important;
}

.logout-btn {
    padding: 0.5rem 1rem;
    font-size: var(--small-font-size);
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: darkred;
}

.action-icons {
    display: flex;
    gap: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Unit Card Styles */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.unit-card {
    width: 100%;
    max-width: 320px;
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    cursor: pointer;
    color: inherit;
    text-decoration: none !important;
}

.unit-card h5 {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.unit-card .status {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.unit-card .icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.6rem;
    color: var(--secondary-color);
}

.unit-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

/* Search Bar Styles */
.search-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: var(--primary-color-dark);
}

/* Table Styles */
.table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background-color: #fff;
}

.table thead {
    background-color: var(--primary-color);
    color: #fff;
}

.table thead th {
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--primary-color-dark);
    font-size: 1rem;
    position: relative;
}

.table thead th::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background-color: var(--primary-color-dark);
    transition: transform 0.3s ease;
    transform: scaleX(0);
}

.table thead th:hover::after {
    transform: scaleX(1);
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    /* font-size: 0.95rem; */
    font-size: 0.875rem;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.table tbody tr {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f1f3f5;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.table .status {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-align: center;
}

.table .status.active {
    background-color: #28a745;
    color: #fff;
}

.table .status.late {
    background-color: #dc3545;
    color: #fff;
}

/* Action Links Styling */
.operation-links a {
    text-decoration: none;
    color: var(--primary-color);
    margin-right: 0.75rem;
    font-weight: 500;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.operation-links a:hover {
    color: var(--primary-color-dark);
    text-decoration: none;
}

.operation-links a.text-danger {
    text-decoration: none;
    color: var(--danger-color);
}

.operation-links a.text-danger:hover {
    text-decoration: none;
    color: darkred;
}

/* Add Tenant Button */
.add-tenant-btn,
.add-unit-btn {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.add-tenant-btn:hover,
.add-unit-btn:hover {
    background-color: #0056b3;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .content-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-bar-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .action-btn {
        width: 100%;
    }

    .action-icons {
        justify-content: center;
        width: 100%;
    }

    .unit-grid {
        grid-template-columns: 1fr;
    }

    .unit-card {
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar {
        left: -250px;
    }

    .sidebar.show {
        left: 0;
    }

    .overlay.show {
        display: block;
    }

    .menu-toggle-btn {
        display: flex;
    }

    .logout-btn {
        width: auto;
        position: static;
        margin-left: auto;
    }
}

@media (min-width: 992px) {
    .menu-toggle-btn {
        display: none;
    }

    .close-btn {
        display: none !important;
    }

    .sidebar {
        left: 0;
    }

    .overlay {
        display: none;
    }

    .content {
        margin-left: 250px;
    }
}

/* Additional Dashboard Styles */
.recent-payments li {
    border-bottom: 1px solid #dee2e6;
}

.chart-container {
    height: 400px;
}

@media (max-width: 767px) {
    .unit-card h5 {
        font-size: 1.4rem;
    }

    .unit-card .status {
        font-size: 1rem;
    }

    .unit-card .icons {
        font-size: 1.4rem;
    }
}

/* Custom Styles for Unit Detail Page */
.nav-tabs {
    border-bottom: 2px solid #ddd;
}

.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
    background-color: #4b4b7a;
    color: #fff;
    border-color: #ddd #ddd #fff;
}

.nav-tabs .nav-link {
    color: #4b4b7a;
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #ddd;
}

.tab-content {
    border: 1px solid #ddd;
    border-top: none;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 0 0 0.25rem 0.25rem;
}

.table {
    margin-top: 1rem;
}

.table thead th {
    background-color: #f8f9fa;
    color: #4b4b7a;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f1f3f5;
}

.table td,
.table th {
    vertical-align: middle;
}

.action-btn,
.btn-danger {
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.action-btn:hover,
.btn-danger:hover {
    opacity: 0.8;
}

.action-icons i {
    font-size: 1.2rem;
    color: #4b4b7a;
    cursor: pointer;
    transition: color 0.3s ease;
}

.action-icons i:hover {
    color: #343a6a;
}

.status {
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
}

.unit-detail-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.unit-detail-header h5 {
    font-weight: 700;
    color: #4b4b7a;
}

.unit-detail-body p {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #6c757d;
}

.unit-detail-footer .action-btn {
    font-weight: 600;
    background-color: #4b4b7a;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.unit-detail-footer .action-btn:hover {
    background-color: #3a3a6a;
}

.unit-detail-footer .action-icons i {
    margin-left: 1rem;
}

/* Custom Styles for Filter */
.filter-container {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.filter-container label {
    margin-right: 15px;
    font-weight: 500;
    font-size: 1rem;
    color: #343a40;
    flex-basis: 100%;
    margin-bottom: 10px; /* Adjust for spacing when stacked */
}

.filter-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.filter-container select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
}

.filter-container .search-bar {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
}

.filter-container .search-btn {
    white-space: nowrap;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px; /* Add margin for spacing when stacked */
}

.filter-container .search-btn:hover {
    background-color: #0056b3;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-wrapper {
        flex-direction: column;
    }

    .filter-container select,
    .filter-container .search-bar,
    .filter-container .search-btn {
        max-width: 100%;
        width: 100%;
        margin-top: 10px; /* Add spacing between elements */
    }

    .filter-container .search-btn {
        margin-top: 15px; /* Add spacing for better layout */
    }
}

/* Custom Styles for General Settings */
.settings-section {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.settings-section h3 {
    font-size: var(--h3-font-size);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.settings-section .form-group {
    margin-bottom: 1.5rem;
}

.settings-section label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: block;
}

.settings-section input,
.settings-section select,
.settings-section textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.3s ease;
}

.settings-section input:focus,
.settings-section select:focus,
.settings-section textarea:focus {
    border-color: var(--primary-color);
}

.settings-section button {
    background-color: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.settings-section button:hover {
    background-color: var(--primary-color-dark);
}

.settings-section .form-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Custom Styles for Sidebar Menu Sections */
.sidebar ul li.section-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.sidebar ul li.section-title + li {
    margin-top: 0;
}

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--background-color);
    font-family: var(--font-family);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border-radius: 10px;
    background-color: var(--card-bg);
}

.login-card {
    padding: 2rem;
    border-radius: 0.75rem;
}

.login-title {
    font-size: var(--h2-font-size);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.login-subtitle {
    font-size: var(--small-font-size);
    color: var(--secondary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
}

.forgot-password {
    font-size: var(--small-font-size);
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-color-dark);
}

.btn-primary {
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 5px;
    background-color: var(--primary-color);
    border: none;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

/* Forgot Password Page Styles */
.back-to-login {
    font-size: var(--small-font-size);
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-login:hover {
    color: var(--primary-color-dark);
}

/* Active Link Styles */
.sidebar ul li a.active {
    color: #fff; /* สีตัวอักษรของลิงก์ที่ active */
    background-color: #3a3a6a; /* พื้นหลังของลิงก์ที่ active */
    border-left: 4px solid #ffcc00; /* เส้นข้างซ้ายเพื่อเน้น */
    padding-left: calc(1rem - 4px); /* ปรับ padding ให้ชิดขอบซ้าย */
    font-weight: 600; /* เน้นความหนาของฟอนต์ */
    transition: background-color 0.3s ease, color 0.3s ease,
        border-color 0.3s ease;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* เพิ่มเงาให้กับลิงก์ที่ active */
}

.sidebar ul li a:hover,
.sidebar ul li a.active:hover {
    color: #ffd700; /* สีตัวอักษรเมื่อ hover หรือ active แล้ว hover */
    background-color: #2e2e58; /* พื้นหลังเมื่อ hover */
    border-left-color: #ffd700; /* เส้นข้างซ้ายเมื่อ hover */
}

/* Original Sidebar Link Styles (without active) */
.sidebar ul li a {
    color: #adb5bd;
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: block;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    border-radius: 0.5rem;
}

.sidebar ul li a:hover {
    color: #ffd700;
    background-color: #3a3a6a;
}

/* Additional Styles for Sidebar Links */
.sidebar ul li {
    margin-bottom: 0.5rem;
}
.avatar-circle {
    width: 50px;
    height: 50px;
    background-color: #007bff; /* สี primary ที่คมชัด */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* ขนาดฟอนต์ที่ใหญ่ขึ้นเพื่อความเด่นชัด */
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* เงาที่นุ่มนวลขึ้น */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* เงาลึกขึ้นเมื่อ hover */
}

/* ซ่อนลูกศรของ dropdown */
.dropdown-toggle::after {
    display: none !important;
}

.sticky-avatar {
    position: sticky;
    top: 1rem;
    z-index: 1050;
}

/* เพิ่มความพรีเมียมให้กับเมนู dropdown */
.dropdown-menu {
    border-radius: 16px; /* เพิ่มความโค้งมนของขอบ */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* เงาที่ลึกและนุ่มนวลขึ้น */
    padding: 15px;
    min-width: 8.75rem !important; /* เพิ่มความกว้างของเมนูให้ดูสมดุลมากขึ้น */
    background-color: #ffffff; /* สีพื้นหลังสีขาว */
    border: none; /* เอาขอบออกเพื่อให้ดูเรียบหรู */
    transition: all 0.3s ease; /* เพิ่มการเปลี่ยนแปลงที่นุ่มนวล */
}

/* ปรับแต่ง dropdown items */
.dropdown-item {
    font-size: 0.875rem;
    color: var(--primary-color-dark);
    padding: 12px 18px; 
    margin-bottom: 8px; 
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.dropdown-item:last-child {
    margin-bottom: 0; /* ลบระยะห่างด้านล่างสุดของรายการสุดท้าย */
}

.dropdown-item:hover {
    background-color: #007bff; /* สีพื้นหลังเมื่อ hover */
    color: #fff; /* สีข้อความเมื่อ hover */
    transform: translateY(-2px); /* เพิ่มเอฟเฟกต์การยกขึ้นเล็กน้อยเมื่อ hover */
}

/* Fullscreen dropdown บนมือถือ */
/* Fullscreen dropdown บนมือถือ */
@media (max-width: 767px) {
    .dropdown-menu {
        position: fixed;
        top: 50px; /* เลื่อนลงจากด้านบนเล็กน้อยเพื่อให้เห็น avatar */
        left: 50%;
        transform: translateX(-50%); /* จัดให้อยู่กึ่งกลางตามแนวนอน */
        width: 90%; /* ใช้ความกว้างที่เหมาะสมกับหน้าจอมือถือ */
        max-width: 320px; /* กำหนดความกว้างสูงสุด */
        padding: 20px;
        background: #ffffff; /* พื้นหลังสีขาว */
        z-index: 1050;
        border-radius: 16px; /* ขอบโค้งมน */
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* เงาที่ลึกและนุ่มนวลขึ้น */
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center; /* จัดรายการทั้งหมดให้อยู่ตรงกลาง */
    }

    .dropdown-menu.show {
        transform: translateX(-50%); /* คงค่า translateX สำหรับแนวนอน */
    }

    .dropdown-menu .avatar-large {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        margin-bottom: 20px;
        background-color: #007bff;
        color: #fff;
        text-align: center;
        line-height: 80px;
        font-size: 32px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto; /* จัดให้อยู่กลางในเมนู */
    }

    .dropdown-menu .menu-item {
        font-size: 18px;
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        color: #333;
        transition: background-color 0.3s ease;
        margin: 10px 0; /* ระยะห่างระหว่างรายการ */
        border-radius: 12px; /* ขอบโค้งมน */
    }

    .dropdown-menu .menu-item:hover {
        background-color: #007bff;
        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* เพิ่มเงาเมื่อ hover */
        transform: translateY(-2px); /* ยกขึ้นเล็กน้อยเมื่อ hover */
    }

    /* เพิ่มการแยก section */
    .dropdown-divider {
        width: 100%;
        height: 1px;
        background-color: #eaeaea; /* สีเส้นที่บางและสว่าง */
        margin: 15px 0; /* เพิ่มระยะห่างด้านบนและล่าง */
    }
}

/* Styles for SwiperJS Plan Display */
.swiper-container {
    width: 100%;
    padding: 2rem 0;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.plan {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    text-align: left;
    width: 100%;
    max-width: 320px;
}

.plan h2 {
    font-size: var(--h3-font-size);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.plan p {
    font-size: var(--body-font-size);
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.plan .btn-primary {
    font-weight: 600;
    font-size: var(--body-font-size);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.plan .btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}


/* General Styles */
:root {
    --primary-color: #4b4b7a;
    --primary-color-dark: #3a3a6a;
    --secondary-color: #6c757d;
    --danger-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #343a40;
    --sidebar-bg: linear-gradient(135deg, #4b4b7a, #343a40);
    --card-bg: #ffffff;
    --card-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    --menu-btn-bg: linear-gradient(135deg, #4b4b7a, #6c757d);
    --menu-btn-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    --font-family: "Poppins", sans-serif;
    --base-font-size: 16px;
    --h1-font-size: 2rem;
    --h2-font-size: 1.75rem;
    --h3-font-size: 1.5rem;
    --h4-font-size: 1.25rem;
    --body-font-size: 1rem;
    --small-font-size: 0.875rem;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--body-font-size);
    margin: 0;
    padding: 0;
}

/* Responsive Font Sizes */
@media (max-width: 1200px) {
    :root {
        --h1-font-size: 1.75rem;
        --h2-font-size: 1.5rem;
        --h3-font-size: 1.25rem;
        --h4-font-size: 1.125rem;
        --body-font-size: 0.9375rem;
    }
}

@media (max-width: 992px) {
    :root {
        --h1-font-size: 1.5rem;
        --h2-font-size: 1.25rem;
        --h3-font-size: 1.125rem;
        --h4-font-size: 1rem;
        --body-font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    :root {
        --h1-font-size: 1.25rem;
        --h2-font-size: 1.125rem;
        --h3-font-size: 1rem;
        --h4-font-size: 0.875rem;
        --body-font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    :root {
        --h1-font-size: 1rem;
        --h2-font-size: 0.9375rem;
        --h3-font-size: 0.875rem;
        --h4-font-size: 0.8125rem;
        --body-font-size: 0.75rem;
    }
}

/* Sidebar Styles */
.sidebar {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    z-index: 1100;
    transition: left 0.3s ease;
    font-size: var(--body-font-size);
    overflow-y: auto; /* Enable scrolling */
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar h2 {
    font-size: var(--h4-font-size);
    font-weight: 600;
    margin-bottom: 1rem;
}

.sidebar ul {
    padding-left: 0;
    list-style: none;
}

.sidebar ul li {
    font-size: var(--body-font-size);
    font-weight: 500;
    margin-bottom: 1rem;
}

.sidebar ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.sidebar ul li a:hover {
    color: #fff;
}

.close-btn {
    font-size: 1.5rem;
    background: none;
    color: #fff;
    border: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    display: none;
}

/* Overlay for Sidebar */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: display 0.3s ease;
}

.overlay.show {
    display: block;
}

/* Content Area */
.content {
    transition: margin-left 0.3s ease;
    padding: 1.5rem;
    margin-left: 250px;
    font-size: var(--body-font-size);
}

/* Menu Button */
.menu-toggle-btn {
    font-size: var(--small-font-size);
    background: var(--menu-btn-bg);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    z-index: 1100;
    position: fixed;
    top: 1rem;
    left: 1rem;
    box-shadow: var(--menu-btn-shadow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

/* Header Styles */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: var(--h2-font-size);
}

.content-header .search-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    font-size: var(--small-font-size);
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.action-btn:hover {
    background-color: var(--primary-color-dark);
}

.secondary-btn {
    padding: 0.5rem 1rem;
    font-size: var(--small-font-size);
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: var(--secondary-color-light);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-btn {
    padding: 0.5rem 1rem;
    font-size: var(--small-font-size);
    font-weight: 600;
    border-radius: 0.5rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: darkred;
}

.action-icons {
    display: flex;
    gap: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Unit Card Styles */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.unit-card {
    width: 100%;
    max-width: 320px;
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    cursor: pointer;
    color: inherit;
    text-decoration: none !important;
}

.unit-card h5 {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.unit-card .status {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.unit-card .icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 1.6rem;
    color: var(--secondary-color);
}

.unit-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

/* Search Bar Styles */
.search-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: var(--primary-color-dark);
}

/* Table Styles */
.table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    background-color: #fff;
}

.table thead {
    background-color: var(--primary-color);
    color: #fff;
}

.table thead th {
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--primary-color-dark);
    font-size: 1rem;
    position: relative;
}

.table thead th::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background-color: var(--primary-color-dark);
    transition: transform 0.3s ease;
    transform: scaleX(0);
}

.table thead th:hover::after {
    transform: scaleX(1);
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
    /* font-size: 0.95rem; */
    font-size: 0.875rem;
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

.table tbody tr {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f1f3f5;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.table .status {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-align: center;
}

.table .status.active {
    background-color: #28a745;
    color: #fff;
}

.table .status.late {
    background-color: #dc3545;
    color: #fff;
}

/* Action Links Styling */
.operation-links a {
    text-decoration: none;
    color: var(--primary-color);
    margin-right: 0.75rem;
    font-weight: 500;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.operation-links a:hover {
    color: var(--primary-color-dark);
    text-decoration: none;
}

.operation-links a.text-danger {
    text-decoration: none;
    color: var(--danger-color);
}

.operation-links a.text-danger:hover {
    text-decoration: none;
    color: darkred;
}

/* Add Tenant Button */
.add-tenant-btn,
.add-unit-btn {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.add-tenant-btn:hover,
.add-unit-btn:hover {
    background-color: #0056b3;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .content-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .search-bar-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .action-btn {
        width: 100%;
    }

    .action-icons {
        justify-content: center;
        width: 100%;
    }

    .unit-grid {
        grid-template-columns: 1fr;
    }

    .unit-card {
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .sidebar {
        left: -250px;
    }

    .sidebar.show {
        left: 0;
    }

    .overlay.show {
        display: block;
    }

    .menu-toggle-btn {
        display: flex;
    }

    .logout-btn {
        width: auto;
        position: static;
        margin-left: auto;
    }
}

@media (min-width: 992px) {
    .menu-toggle-btn {
        display: none;
    }

    .close-btn {
        display: none !important;
    }

    .sidebar {
        left: 0;
    }

    .overlay {
        display: none;
    }

    .content {
        margin-left: 250px;
    }
}

/* Additional Dashboard Styles */
.recent-payments li {
    border-bottom: 1px solid #dee2e6;
}

.chart-container {
    height: 400px;
}

@media (max-width: 767px) {
    .unit-card h5 {
        font-size: 1.4rem;
    }

    .unit-card .status {
        font-size: 1rem;
    }

    .unit-card .icons {
        font-size: 1.4rem;
    }
}

/* Custom Styles for Unit Detail Page */
.nav-tabs {
    border-bottom: 2px solid #ddd;
}

.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
    background-color: #4b4b7a;
    color: #fff;
    border-color: #ddd #ddd #fff;
}

.nav-tabs .nav-link {
    color: #4b4b7a;
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
}

.nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #ddd;
}

.tab-content {
    border: 1px solid #ddd;
    border-top: none;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 0 0 0.25rem 0.25rem;
}

.table {
    margin-top: 1rem;
}

.table thead th {
    background-color: #f8f9fa;
    color: #4b4b7a;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f1f3f5;
}

.table td,
.table th {
    vertical-align: middle;
}

.action-btn,
.btn-danger {
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.action-btn:hover,
.btn-danger:hover {
    opacity: 0.8;
}

.action-icons i {
    font-size: 1.2rem;
    color: #4b4b7a;
    cursor: pointer;
    transition: color 0.3s ease;
}

.action-icons i:hover {
    color: #343a6a;
}

.status {
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
}

.unit-detail-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.unit-detail-header h5 {
    font-weight: 700;
    color: #4b4b7a;
}

.unit-detail-body p {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #6c757d;
}

.unit-detail-footer .action-btn {
    font-weight: 600;
    background-color: #4b4b7a;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.unit-detail-footer .action-btn:hover {
    background-color: #3a3a6a;
}

.unit-detail-footer .action-icons i {
    margin-left: 1rem;
}

/* Custom Styles for Filter */
.filter-container {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.filter-container label {
    margin-right: 15px;
    font-weight: 500;
    font-size: 1rem;
    color: #343a40;
    flex-basis: 100%;
    margin-bottom: 10px; /* Adjust for spacing when stacked */
}

.filter-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.filter-container select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
}

.filter-container .search-bar {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
}

.filter-container .search-btn {
    white-space: nowrap;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px; /* Add margin for spacing when stacked */
}

.filter-container .search-btn:hover {
    background-color: #0056b3;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-wrapper {
        flex-direction: column;
    }

    .filter-container select,
    .filter-container .search-bar,
    .filter-container .search-btn {
        max-width: 100%;
        width: 100%;
        margin-top: 10px; /* Add spacing between elements */
    }

    .filter-container .search-btn {
        margin-top: 15px; /* Add spacing for better layout */
    }
}

/* Custom Styles for General Settings */
.settings-section {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.settings-section h3 {
    font-size: var(--h3-font-size);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.settings-section .form-group {
    margin-bottom: 1.5rem;
}

.settings-section label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: block;
}

.settings-section input,
.settings-section select,
.settings-section textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.3s ease;
}

.settings-section input:focus,
.settings-section select:focus,
.settings-section textarea:focus {
    border-color: var(--primary-color);
}

.settings-section button {
    background-color: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.settings-section button:hover {
    background-color: var(--primary-color-dark);
}

.settings-section .form-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Custom Styles for Sidebar Menu Sections */
.sidebar ul li.section-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.sidebar ul li.section-title + li {
    margin-top: 0;
}

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--background-color);
    font-family: var(--font-family);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border-radius: 10px;
    background-color: var(--card-bg);
}

.login-card {
    padding: 2rem;
    border-radius: 0.75rem;
}

.login-title {
    font-size: var(--h2-font-size);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.login-subtitle {
    font-size: var(--small-font-size);
    color: var(--secondary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
}

.forgot-password {
    font-size: var(--small-font-size);
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-color-dark);
}

.btn-primary {
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 5px;
    background-color: var(--primary-color);
    border: none;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

/* Forgot Password Page Styles */
.back-to-login {
    font-size: var(--small-font-size);
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-to-login:hover {
    color: var(--primary-color-dark);
}

/* Active Link Styles */
.sidebar ul li a.active {
    color: #fff; /* สีตัวอักษรของลิงก์ที่ active */
    background-color: #3a3a6a; /* พื้นหลังของลิงก์ที่ active */
    border-left: 4px solid #ffcc00; /* เส้นข้างซ้ายเพื่อเน้น */
    padding-left: calc(1rem - 4px); /* ปรับ padding ให้ชิดขอบซ้าย */
    font-weight: 600; /* เน้นความหนาของฟอนต์ */
    transition: background-color 0.3s ease, color 0.3s ease,
        border-color 0.3s ease;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* เพิ่มเงาให้กับลิงก์ที่ active */
}

.sidebar ul li a:hover,
.sidebar ul li a.active:hover {
    color: #ffd700; /* สีตัวอักษรเมื่อ hover หรือ active แล้ว hover */
    background-color: #2e2e58; /* พื้นหลังเมื่อ hover */
    border-left-color: #ffd700; /* เส้นข้างซ้ายเมื่อ hover */
}

/* Original Sidebar Link Styles (without active) */
.sidebar ul li a {
    color: #adb5bd;
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: block;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    border-radius: 0.5rem;
}

.sidebar ul li a:hover {
    color: #ffd700;
    background-color: #3a3a6a;
}

/* Additional Styles for Sidebar Links */
.sidebar ul li {
    margin-bottom: 0.5rem;
}
.avatar-circle {
    width: 50px;
    height: 50px;
    background-color: #007bff; /* สี primary ที่คมชัด */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* ขนาดฟอนต์ที่ใหญ่ขึ้นเพื่อความเด่นชัด */
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* เงาที่นุ่มนวลขึ้น */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* เงาลึกขึ้นเมื่อ hover */
}

/* ซ่อนลูกศรของ dropdown */
.dropdown-toggle::after {
    display: none !important;
}

.sticky-avatar {
    position: sticky;
    top: 1rem;
    z-index: 1050;
}

/* เพิ่มความพรีเมียมให้กับเมนู dropdown */
.dropdown-menu {
    border-radius: 16px; /* เพิ่มความโค้งมนของขอบ */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* เงาที่ลึกและนุ่มนวลขึ้น */
    padding: 15px;
    min-width: 8.75rem !important; /* เพิ่มความกว้างของเมนูให้ดูสมดุลมากขึ้น */
    background-color: #ffffff; /* สีพื้นหลังสีขาว */
    border: none; /* เอาขอบออกเพื่อให้ดูเรียบหรู */
    transition: all 0.3s ease; /* เพิ่มการเปลี่ยนแปลงที่นุ่มนวล */
}

/* ปรับแต่ง dropdown items */
.dropdown-item {
    font-size: 0.875rem;
    color: var(--primary-color-dark);
    padding: 12px 18px; 
    margin-bottom: 8px; 
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.dropdown-item:last-child {
    margin-bottom: 0; /* ลบระยะห่างด้านล่างสุดของรายการสุดท้าย */
}

.dropdown-item:hover {
    background-color: #007bff; /* สีพื้นหลังเมื่อ hover */
    color: #fff; /* สีข้อความเมื่อ hover */
    transform: translateY(-2px); /* เพิ่มเอฟเฟกต์การยกขึ้นเล็กน้อยเมื่อ hover */
}

.dropdown-item button{
    font-size: 0.875rem !important;
}

/* Fullscreen dropdown บนมือถือ */
/* Fullscreen dropdown บนมือถือ */
@media (max-width: 767px) {
    .dropdown-menu {
        position: fixed;
        top: 50px; /* เลื่อนลงจากด้านบนเล็กน้อยเพื่อให้เห็น avatar */
        left: 50%;
        transform: translateX(-50%); /* จัดให้อยู่กึ่งกลางตามแนวนอน */
        width: 90%; /* ใช้ความกว้างที่เหมาะสมกับหน้าจอมือถือ */
        max-width: 320px; /* กำหนดความกว้างสูงสุด */
        padding: 20px;
        background: #ffffff; /* พื้นหลังสีขาว */
        z-index: 1050;
        border-radius: 16px; /* ขอบโค้งมน */
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* เงาที่ลึกและนุ่มนวลขึ้น */
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center; /* จัดรายการทั้งหมดให้อยู่ตรงกลาง */
    }

    .dropdown-menu.show {
        transform: translateX(-50%); /* คงค่า translateX สำหรับแนวนอน */
    }

    .dropdown-menu .avatar-large {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        margin-bottom: 20px;
        background-color: #007bff;
        color: #fff;
        text-align: center;
        line-height: 80px;
        font-size: 32px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto; /* จัดให้อยู่กลางในเมนู */
    }

    .dropdown-menu .menu-item {
        font-size: 18px;
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        color: #333;
        transition: background-color 0.3s ease;
        margin: 10px 0; /* ระยะห่างระหว่างรายการ */
        border-radius: 12px; /* ขอบโค้งมน */
    }

    .dropdown-menu .menu-item:hover {
        background-color: #007bff;
        color: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* เพิ่มเงาเมื่อ hover */
        transform: translateY(-2px); /* ยกขึ้นเล็กน้อยเมื่อ hover */
    }

    /* เพิ่มการแยก section */
    .dropdown-divider {
        width: 100%;
        height: 1px;
        background-color: #eaeaea; /* สีเส้นที่บางและสว่าง */
        margin: 15px 0; /* เพิ่มระยะห่างด้านบนและล่าง */
    }
}
/* Plan container styling */
.plans-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden; /* Prevents scrolling */
    background: linear-gradient(135deg, #f8f9fa 0%, #e3e7ef 100%);
}

/* Plan card styling */
.plan {
    background-color: #fff;
    padding: 20px;
    border-radius: 15px; /* More rounded corners */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); /* Stronger shadow */
    text-align: center;
    max-width: 320px;
    margin: 0 auto;
    border: 1px solid #e0e0e0; /* Subtle border for definition */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.plan:hover {
    transform: translateY(-5px); /* Slight lift on hover */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15); /* Stronger shadow on hover */
}

.plan h2 {
    font-size: 1.75rem; /* Larger font */
    margin-bottom: 15px;
    color: #333;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); /* Subtle text shadow */
}

.plan p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

.plan .btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    font-size: 1.125rem; /* Slightly larger font */
    padding: 12px 20px;
    border-radius: 50px; /* Rounded button */
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Button shadow */
}

.plan .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Adjust dots styling */
.swiper-pagination-bullet {
    background: #007bff;
    opacity: 1;
    width: 12px;
    height: 12px;
}

.swiper-pagination-bullet-active {
    background: #0056b3;
    transform: scale(1.2); /* Slightly larger active dot */
}

/* Ensure Swiper container has relative positioning */
.plans-swiper {
    position: relative;
    padding: 30px 0; /* Add more padding for spacing */
    overflow: hidden; /* Prevents scrolling within the Swiper */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .swiper-pagination {
        display: block;
        position: relative;
        bottom: 10px;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .plan {
        padding: 15px;
    }

    .plan h2 {
        font-size: 1.5rem;
    }

    .plan p {
        font-size: 0.875rem;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 10px;
    }
}

.btn-full{
    width:100% !important;
    text-align: center;
}
.link-btn{
    text-decoration: none !important;
    color:var(--primary-color);
    cursor: pointer;
}
.link-btn:hover{
    text-decoration: none !important;
    color:var(--third--color);
    cursor: pointer;
}
.text-btn{
    box-shadow: 0px 1px;
    border-radius: 8px;
    padding: 4px 8px;
    text-decoration: none;

}
.text-btn:hover{
    box-shadow: 0px 1px;
    border-radius: 8px;
    padding: 4px 8px;
    text-decoration: none;
    background-color: #f8f8f8;
}
/** memu list page */
.dropdown-menu{
    border:0px !important;
}
.dropdown-item:hover{
    border-radius:0px 0px !important;
}

#paymentFrm .form-group{
    padding:8px 8px;
}
#paymentFrm .form-group p{
    margin-bottom:0px !important ;
}

/* Overwrite pagging */
.pagination > li > a
{
    background-color: white;
    color: var(--primary-color);
}

.pagination > li > a:focus,
.pagination > li > a:hover,
.pagination > li > span:focus,
.pagination > li > span:hover
{
    color: var(--primary-color);
    background-color: #eee;
    border-color: #ddd;
}

.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color:  var(--primary-color) !important;
    border-color:  var(--primary-color) !important;
}
/*#Overwrite pagging */

/* Auto complate demo */
.autocomplete {
    position: relative;
}
.autocomplete-items {
    position: absolute;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 99;
    background-color: white;
    width: 100%;
}
.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
}
.autocomplete-items div:hover {
    background-color: #f1f1f1;
}
.autocomplete-active{
    color: red;
}
/* #Auto complate demo */

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}
.title-page{
    color: var(--primary-color-dark);
    text-shadow: 4px 2px 20px #4345644a;
}
.table-bar{
    border-bottom:1px solid #f6f5f6;
    box-shadow: rgba(33, 35, 38, 0.1) 0px 15px 10px -10px;
}
.table-list{
    border-top: 1px solid #f6f6f7;
    box-shadow: rgb(205 205 205 / 65%) 0px 4px 36px -28px inset;
}
.avatar-circle{
    background-color: var(--primary-color-dark) !important;
}


/* ลดขนาด Dropdown Menu */
.dropdown-menu {
    min-width: 180px;
    font-size: 14px;
    z-index: 1050; /* ให้ dropdown อยู่ด้านบนสุด */
    max-height: 300px; /* กำหนดความสูงสูงสุด */
    overflow-y: auto; /* ให้สามารถเลื่อน Scroll ได้ */
}

/* ปรับแต่งให้เมนูดูดีขึ้น */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

/* ป้องกัน dropdown ถูกตัดจาก table-responsive */
.table-responsive {
    overflow: visible !important;
}

/* ถ้าอยู่ใกล้ขอบล่างให้เปิดขึ้น */
.dropup .dropdown-menu {
    bottom: 100%;
    top: auto;
    transform: translateY(-5px);
}

/* Animation ของ dropdown */
.dropdown-menu {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    transform: scale(1);
}
