/* Modern visual layer. Layout and behavior stay the same. */

:root {
    --ui-font: "Inter", "Open Sans", "Segoe UI", sans-serif;
    --ui-bg: #f4f6fb;
    --ui-surface: #ffffff;
    --ui-text: #1f2937;
    --ui-muted: #667085;
    --ui-line: #e7ebf3;
    --ui-soft: #f3f5f9;
    --ui-radius: 12px;
    --ui-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

html,
body {
    font-family: var(--ui-font);
    background-color: var(--ui-bg);
    color: var(--ui-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.page-title h1,
.page-title h4,
.card-header,
.modal-title {
    font-family: var(--ui-font);
    letter-spacing: -0.02em;
}

h1, h2, h3, h4 {
    font-weight: 600;
    color: #111827;
}

/* Icons */
svg.feather {
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon,
.icon-16 {
    vertical-align: -3px;
}

/* Sidebar */
.sidebar {
    background: var(--ui-surface);
    box-shadow: 1px 0 0 var(--ui-line) !important;
    border-right: 0;
}

.sidebar-brand {
    height: 64px;
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-line);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
}

.sidebar-brand .dashboard-image {
    max-height: 36px;
    width: auto;
}

.sidebar-scroll {
    margin-top: 64px;
    background: var(--ui-surface);
}

.sidebar-menu {
    padding: 12px 0 24px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 12px;
    padding: 9px 12px;
    border-radius: 10px;
    font-weight: 500;
    color: #4b5563;
}

.sidebar-menu li a span {
    margin-left: 0;
}

.sidebar-menu li a svg.feather {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #667085;
}

.sidebar-menu li a:hover,
.sidebar-menu li a:focus {
    background: var(--ui-soft);
    color: #111827;
}

.sidebar-menu li.active > a {
    color: #fff !important;
    box-shadow: 0 8px 16px rgba(16, 24, 40, 0.16);
}

.sidebar-menu li.active > a svg.feather {
    color: #fff;
}

.sidebar-menu li ul li a {
    margin: 1px 12px 1px 22px;
    padding: 8px 12px;
    font-weight: 500;
    border-radius: 8px;
}

.sidebar-menu .badge {
    float: none;
    margin-left: auto;
    margin-top: 0 !important;
    font-weight: 600;
}

#sidebar-menu li.expand > a::before,
#sidebar-menu li.expand.open > a::before {
    top: 50%;
    margin-top: -3px;
    right: 16px;
}

/* Top bar */
.navbar-custom {
    left: 250px;
    min-height: 64px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--ui-line);
    box-shadow: none;
    backdrop-filter: saturate(1.2) blur(8px);
}

.navbar-nav .nav-link {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.navbar-nav .nav-link svg.feather {
    width: 18px;
    height: 18px;
    color: #475467;
}

.page-container {
    margin-top: 64px;
}

/* Page structure */
.page-wrapper {
    padding: 22px 24px 32px;
}

.page-title {
    background: transparent;
    border-bottom: 0;
    border-radius: 0;
}

.page-title h1,
.page-title h4 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.nav-tabs.bg-white.title,
ul.nav-tabs.title {
    border: 1px solid var(--ui-line);
    border-radius: 14px 14px 0 0;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
}

.nav-tabs .nav-link,
.nav-tabs li a {
    font-weight: 500;
}

.card {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow) !important;
    overflow: hidden;
}

.card .card-header,
.bg-white .card-header {
    background: var(--ui-surface);
    border-color: var(--ui-line);
    padding: 14px 18px;
    font-weight: 600;
}

.card .card-body {
    padding: 18px;
}

.card .nav-tabs {
    box-shadow: none;
    border-radius: 0;
}

.card-footer {
    background: #fafbff;
    border-top: 1px solid var(--ui-line);
}

/* Buttons and fields */
.btn {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: none;
}

.btn-primary {
    box-shadow: 0 8px 16px rgba(16, 24, 40, 0.16);
}

.btn-default,
.btn-secondary {
    background: #fff;
    border-color: #d0d5dd;
}

.form-control,
.select2-container .select2-choice,
.select2-container .select2-selection,
.general-form .form-control {
    border-radius: 8px !important;
    border: 1px solid #d0d5dd !important;
    background: #fff !important;
    min-height: 38px;
    color: var(--ui-text);
    box-shadow: none !important;
}

.form-control:focus,
.select2-container-active .select2-choice,
.select2-container--focus .select2-selection {
    border-color: #6690F4 !important;
    box-shadow: 0 0 0 3px rgba(102, 144, 244, 0.15) !important;
}

/* Tables */
table.dataTable {
    border-collapse: separate !important;
}

table.dataTable thead th {
    background: #f8fafc;
    color: #667085 !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-top: 0 !important;
    border-bottom: 1px solid var(--ui-line) !important;
}

.dataTable:not(.js-selection-mode) tbody tr:hover td {
    background: #f8fafc;
}

table.dataTable tbody td {
    border-color: #f2f4f7 !important;
    color: #344054;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: 4px 8px;
}

/* Dialogs and menus */
.modal-content,
.dropdown-menu,
.app-modal .modal-content {
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.14);
}

.modal-header,
.modal-footer {
    border-color: var(--ui-line);
}

.dropdown-item {
    border-radius: 8px;
    margin: 2px 6px;
    width: auto;
    font-weight: 500;
}

.dropdown-menu {
    padding: 6px;
}

/* Sign in */
.signin-page {
    background: linear-gradient(180deg, #eef3ff 0%, #f7f8fb 42%, #f4f6fb 100%);
}

.signin-page .form-signin {
    max-width: 420px;
    margin: 8vh auto;
}

.signin-page .form-signin .card {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.1) !important;
}

.signin-page .form-signin .card-header {
    border-bottom: 0;
    padding: 28px 28px 0;
}

.signin-page .form-signin .card-body {
    padding: 22px 28px 28px;
}

.signin-page .form-signin .btn-lg {
    border-radius: 10px;
    padding: 10px 16px;
    margin-top: 6px;
}

@media (max-width: 767px) {
    .navbar-custom {
        left: 0;
    }

    .page-wrapper {
        padding: 14px;
    }
}
