/* Color Variables */
:root {
    --primary-color: #bf4f1f;
    --secondary-color: #1a2b54;
    --primary-hover: #a8431b;
    --secondary-hover: #152445;
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --sidebar-width: 300px;
}

html {
  font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styles - Modern White Design */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    color: var(--text-dark);
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
    border-right: 1px solid #e9ecef;
}

.sidebar-header {
    padding: 25px 20px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}

.app-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.app-name span {
    background: linear-gradient(135deg, var(--primary-color), #d4693e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-name i {
    font-size: 1.8rem;
}

.btn-toggle {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: var(--text-dark);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Sidebar Navigation - Modern Design */
.components {
    padding: 10px 15px;
    list-style: none;
    margin: 0;
}

.components li {
    margin: 4px 0;
}

.components .nav-link {
    color: #495057;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    margin: 2px 0;
}

.components .nav-link i {
    width: 24px;
    height: 24px;
    text-align: center;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* Colorized Icons using data-menu attributes */
.components .nav-link[data-menu="dashboard"] i {
    color: #bf4f1f;
    background: rgba(191, 79, 31, 0.1);
}

.components .nav-link[data-menu="country"] i {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.components .nav-link[data-menu="area"] i {
    color: #17a2b8;
    background: rgba(23, 162, 184, 0.1);
}

.components .nav-link[data-menu="city"] i {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.components .nav-link[data-menu="region"] i {
    color: #0dcaf0;
    background: rgba(13, 202, 240, 0.1);
}

.components .nav-link[data-menu="district"] i {
    color: #6f42c1;
    background: rgba(111, 66, 193, 0.1);
}

.components .nav-link[data-menu="organization"] i {
    color: #fd7e14;
    background: rgba(253, 126, 20, 0.1);
}

.components .nav-link[data-menu="branch"] i {
    color: #e83e8c;
    background: rgba(232, 62, 140, 0.1);
}

.components .nav-link[data-menu="bank"] i {
    color: #20c997;
    background: rgba(32, 201, 151, 0.1);
}

.components .nav-link[data-menu="realestatetype"] i {
    color: #795548;
    background: rgba(121, 85, 72, 0.1);
}

.components .nav-link[data-menu="realestateusage"] i {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.components .nav-link[data-menu="facilities"] i {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.components .nav-link[data-menu="unittype"] i {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

.components .nav-link[data-menu="unitusage"] i {
    color: #0dcaf0;
    background: rgba(13, 202, 240, 0.1);
}

.components .nav-link[data-menu="unitfacilities"] i {
    color: #6610f2;
    background: rgba(102, 16, 242, 0.1);
}

.components .nav-link[data-menu="nationality"] i {
    color: #198754;
    background: rgba(25, 135, 84, 0.1);
}

.components .nav-link[data-menu="identity"] i {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
}

.components .nav-link[data-menu="property"] i {
    color: var(--primary-color);
    background: rgba(191, 79, 31, 0.1);
}

.components .nav-link[data-menu="contract"] i {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

/* Tree Menu Header Icons */
.components .nav-link.dropdown-toggle i {
    color: var(--primary-color);
    background: rgba(191, 79, 31, 0.1);
}

.components .nav-link:hover {
    background: #f8f9fa;
    color: var(--text-dark);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.components .nav-link:hover i {
    transform: scale(1.1);
}

.components .nav-link.active {
    background: linear-gradient(90deg, rgba(191, 79, 31, 0.15) 0%, rgba(191, 79, 31, 0.05) 100%);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
    padding-left: 12px;
}

.components .nav-link.active i {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Dropdown Toggle for Tree Menu */
.components .nav-link.dropdown-toggle {
    position: relative;
}

.components .nav-link.dropdown-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    border: none;
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.85rem;
}

.components .nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Nested Menu Items */
.components .collapse {
    padding-left: 20px;
    margin-top: 4px;
}

.components .collapse .nav-link {
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 20px;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.components .collapse .nav-link:hover {
    border-left-color: var(--primary-color);
    background: rgba(191, 79, 31, 0.05);
    transform: translateX(5px);
}

.components .collapse .nav-link.active {
    border-left-color: var(--primary-color);
    background: linear-gradient(90deg, rgba(191, 79, 31, 0.1) 0%, rgba(191, 79, 31, 0.05) 100%);
    padding-left: 18px;
}

.components .collapse .nav-link i {
    width: 20px;
    height: 20px;
    font-size: 0.95rem;
}

/* Content Wrapper */
.content-wrapper {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.main-content {
    padding: 30px;
    background-color: #f5f7fa;
    min-height: calc(100vh - 60px);
}

/* Page Header */
.page-header {
    background: var(--text-light);
    padding: 25px 30px;
    margin: -30px -30px 30px -30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: none;
}

.page-header h1 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1.8rem;
    font-weight: 600;
}

.page-header .d-flex {
    align-items: center;
}

.page-header .btn-outline-info {
    white-space: nowrap;
}

/* Content Cards */
.content-card {
    background: var(--text-light);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-color);
}

/* Modern Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, #d4693e 100%);
    border: none;
    color: var(--text-light);
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(191, 79, 31, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-custom i {
    font-size: 0.95rem;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #c85a2f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 79, 31, 0.35);
    color: var(--text-light);
}

.btn-primary-custom:active,
.btn-primary-custom.active,
.btn-primary-custom.show {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(191, 79, 31, 0.25);
    background: linear-gradient(135deg, var(--primary-hover) 0%, #c85a2f 100%);
}

/* Button group with primary custom button */
.btn-group .btn-primary-custom {
    border-radius: 8px;
}

.btn-group .btn-primary-custom:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn-primary-custom + .dropdown-toggle {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-secondary-custom {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-secondary-custom:hover {
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 43, 84, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.active {
        margin-left: 0;
    }

    .content-wrapper {
        width: 100%;
        margin-left: 0;
    }

    .main-content {
        padding: 20px 15px;
    }

    .page-header {
        margin: -20px -15px 20px -15px;
        padding: 20px 15px;
    }
}

/* Scrollbar Styling - Modern White Theme */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
    border: 2px solid #f8f9fa;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    animation: fadeIn 0.3s ease-in;
}

/* Pagination Styles */
.pagination {
    margin-top: 20px;
}

.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
}

.pagination .page-link:hover {
    color: var(--primary-hover);
    background-color: rgba(191, 79, 31, 0.1);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #dee2e6;
}

/* Modern Search Input Styles */
.input-group {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(191, 79, 31, 0.15);
}

.input-group .form-control {
    border: none;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    border-radius: 0;
    transition: all 0.3s ease;
    box-shadow: none;
}

.input-group .form-control:focus {
    border: none;
    box-shadow: none;
    outline: none;
    background-color: #fff;
}

.input-group .form-control::placeholder {
    color: #adb5bd;
    font-size: 0.9rem;
}

.input-group .btn {
    border: none;
    border-left: none;
    border-radius: 0;
    padding: 0.65rem 1rem;
    transition: all 0.3s ease;
    background-color: transparent;
}

.input-group .btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: none;
}

.input-group .btn:first-of-type {
    border-radius: 0 8px 8px 0;
}

/* Action Bar Styles */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Modern Action Buttons (Export, Import, Delete, etc.) */
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary,
.btn-outline-info {
    border: 1.5px solid;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 42px;
    height: 42px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(191, 79, 31, 0.05);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(191, 79, 31, 0.3);
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.btn-outline-danger:hover:not(:disabled) {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-outline-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(220, 53, 69, 0.05);
}

.btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.05);
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.05);
}

.btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

/* Icon Button Styles */
.btn-outline-primary i,
.btn-outline-danger i,
.btn-outline-secondary i,
.btn-outline-info i {
    font-size: 1rem;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    transform: translateX(3px);
}

.dropdown-item:active {
    background-color: rgba(191, 79, 31, 0.1);
    color: var(--primary-color);
}

/* Responsive Action Bar */
@media (max-width: 768px) {
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-bar > div {
        width: 100%;
    }
    
    .action-bar .d-flex.gap-2 {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Mobile Table Responsive */
    .table {
        font-size: 0.85rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.75rem;
    }

    .btn-primary-custom,
    .btn-outline-primary,
    .btn-outline-danger,
    .btn-outline-secondary {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }

    .input-group .form-control {
        min-width: 200px;
    }
}

/* Switch Select Input Styles */
.switch-input-wrapper {
    width: 100%;
}

.switch-select {
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.switch-select:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(191, 79, 31, 0.25);
}

.switch-select option {
    padding: 0.5rem;
}

/* Input Group Icon Styles */
.input-group-text {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group-text i {
    font-size: 1rem;
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(191, 79, 31, 0.25);
}

/* Readonly Input Styles */
.form-control[readonly],
.form-select:disabled {
    background-color: #f8f9fa;
    opacity: 1;
    cursor: not-allowed;
}

.form-select:disabled {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* Modern Data Table Design */
.table {
    border-collapse: separate;
    border-spacing: 0;
    border: none;
    border-top: none;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    width: 100%;
    min-width: max-content;
    margin-bottom: 0;
}

.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    border-top: none;
    position: relative;
}

/* Custom scrollbar for table-responsive (horizontal only) */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table thead th {
    background: var(--primary-color);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.65rem 1.25rem;
    vertical-align: middle;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    border-bottom: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15ch;
    line-height: 1.2;
}

.table thead th:first-child {
    border-top-left-radius: 12px;
}

.table thead th:last-child {
    border-top-right-radius: 12px;
    border-right: none;
}

.table tbody td {
    border: none;
    border-right: 1px solid #e9ecef;
    padding: 0.65rem 1.25rem;
    vertical-align: middle;
    font-size: 0.95rem;
    color: #495057;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15ch;
    line-height: 1.2;
}

/* Remove border from Actions column (last column) */
.table tbody td:last-child {
    border-right: none;
}

.table tbody tr {
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.table tbody tr:hover {
    background-color: #f0f7ff !important;
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(191, 79, 31, 0.08);
}

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

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Checkbox in table */
.table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Badge styling in table */
.table .badge {
    padding: 0.4em 0.75em;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Action buttons in table */
.table .btn-group-sm .btn {
    padding: 0.21rem 0.39rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin: 0 1px;
    font-size: 0.75rem;
}

.table .btn-group-sm .btn i {
    font-size: 0.75rem;
}

.table .btn-group-sm .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.table .btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.table .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.table .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Empty state */
.table tbody tr td.text-center {
    padding: 3rem 1rem;
}

.table tbody tr td.text-center i {
    color: #adb5bd;
    margin-bottom: 1rem;
}

/* Dashboard Stat Cards - Enhanced Design */
.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #d4693e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(191, 79, 31, 0.15);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon i {
    font-size: 1.875rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.05);
}

.stat-label {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0.5rem 0 0 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-trend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend i {
    font-size: 1.2rem;
}

/* Dashboard Chart Cards - Enhanced Design */
.chart-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-top: 4px solid var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    overflow: hidden;
    position: relative;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(191, 79, 31, 0.15);
}

.chart-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    position: relative;
}

.chart-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #d4693e);
}

.chart-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-title i {
    color: var(--primary-color);
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(191, 79, 31, 0.1), rgba(191, 79, 31, 0.05));
    border-radius: 8px;
}

.chart-body {
    padding: 1.5rem;
    min-height: 400px;
    background: #ffffff;
}

/* Dashboard Card Headers (Legacy support) */
.card-header-custom {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.card-body-custom {
    padding: 0;
    min-height: 200px;
}

/* Recent List Items */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid #f0f0f0;
}

.recent-item:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.recent-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(191, 79, 31, 0.15), rgba(191, 79, 31, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recent-item-icon i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.recent-item-content {
    flex: 1;
}

.recent-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0 0.25rem 0;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.quick-stat-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.quick-stat-item i {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.quick-stat-item h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-stat-item p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}

/* System Info */
.system-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.info-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.info-item i {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.info-item h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0;
}

/* Enhanced Tabs Design for Property Create */
.tabs-wrapper {
    margin-bottom: 0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.nav-tabs {
    border: none;
    border-bottom: 2px solid #e9ecef;
    background: transparent;
    border-radius: 12px 12px 0 0;
    padding: 0.75rem 0.75rem 0 0.75rem;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-tabs .nav-item {
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #6c757d;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.nav-tabs .nav-link i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
    color: #6c757d;
}

.nav-tabs .nav-link:hover {
    background: rgba(191, 79, 31, 0.05);
    color: var(--primary-color);
    border-bottom-color: rgba(191, 79, 31, 0.3);
    transform: translateY(-2px);
}

.nav-tabs .nav-link:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.nav-tabs .nav-link.active {
    background: #ffffff;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: 700;
    box-shadow: 0 -2px 8px rgba(191, 79, 31, 0.1);
    position: relative;
    z-index: 1;
}

.nav-tabs .nav-link.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #d4693e);
    border-radius: 12px 12px 0 0;
}

.nav-tabs .nav-link.active i {
    color: var(--primary-color);
    transform: scale(1.15);
}

.nav-tabs .nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(191, 79, 31, 0.15);
}

/* Enhanced Tab Content */
.tab-content {
    background: #ffffff;
    border-radius: 0 12px 12px 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    min-height: 400px;
  position: relative;
}

.tab-pane {
    animation: fadeInTab 0.3s ease-in;
}

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

.tab-pane.active {
    display: block;
}

/* Tab Content Headings */
.tab-content h4,
.tab-content h5 {
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tab-content h4 i,
.tab-content h5 i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Tab Content Sections */
.tab-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.tab-section:hover {
    background: #f0f7ff;
    border-left-color: #d4693e;
    box-shadow: 0 2px 8px rgba(191, 79, 31, 0.08);
}

.tab-section-title {
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-section-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Responsive Tabs */
@media (max-width: 768px) {
    .nav-tabs {
        padding: 0.5rem 0.5rem 0 0.5rem;
        gap: 0.25rem;
    }

    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .nav-tabs .nav-link i {
        font-size: 1rem;
    }

    .tab-content {
        padding: 1.25rem;
        border-radius: 0 8px 8px 8px;
    }

    .tab-section {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .nav-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-tabs .nav-link {
        border-radius: 8px;
        border-bottom: 3px solid transparent;
        margin-bottom: 0;
    }

    .nav-tabs .nav-link.active {
        border-radius: 8px;
        border-bottom: 3px solid var(--primary-color);
    }

    .nav-tabs .nav-link.active::before {
        display: none;
    }

    .tab-content {
        border-radius: 8px;
        padding: 1rem;
    }
}

/* Responsive Dashboard */
@media (max-width: 992px) {
    .stat-card {
        padding: 1.5rem;
    }

    .stat-icon {
        width: 56px;
        height: 56px;
    }

    .stat-icon i {
        font-size: 1.625rem;
    }

    .stat-value {
        font-size: 1.875rem;
    }

    .chart-body {
        min-height: 350px;
        padding: 1.25rem;
    }

    .chart-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .stat-card {
        padding: 1.25rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
    }

    .stat-icon i {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .chart-body {
        min-height: 300px;
        padding: 1rem;
    }

    .chart-title {
        font-size: 0.95rem;
    }

    .card-body-custom {
        min-height: 150px;
    }
}

/* Facilities and Amenities Modern Cards */
.facility-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.facility-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(191, 79, 31, 0.15);
}

.facility-card.active {
    background: linear-gradient(135deg, #fff5f2 0%, #ffffff 100%);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(191, 79, 31, 0.2);
}

.facility-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.facility-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(191, 79, 31, 0.3);
}

.facility-card.active .facility-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 12px rgba(191, 79, 31, 0.4);
}

.facility-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.facility-info {
    flex: 1;
    min-width: 0;
}

.facility-quantity-select {
    flex-shrink: 0;
    width: 70px;
}

.facility-quantity-dropdown {
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 13px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.facility-quantity-dropdown:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(191, 79, 31, 0.25);
}

.facility-quantity-dropdown:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.facility-card.active .facility-quantity-dropdown {
    border-color: var(--primary-color);
}

.facility-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    line-height: 1.4;
}

.facility-name-ar {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}


.facilities-section-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
}

#facilitiesContainer {
    margin: 0;
}