:root {
    --full-primary: #2584ff;
    --full-primary-hover: #1474f2;
    --full-success: #17c653;
    --full-danger: #f8285a;
    --full-warning: #f6c000;
    --full-info: #7239ea;
    --full-text: #02091e;
    --full-muted: #7e8aa7;
    --full-border: #d7dfef;
    --full-page: #f3f5f9;
    --full-surface: #ffffff;
    --full-soft: #eaf4ff;
    --full-radius: 8px;
    --full-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--full-page);
    color: var(--full-text);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}

a {
    color: #06f;
    text-decoration: none;
}

a:hover {
    color: var(--full-primary-hover);
    text-decoration: none;
}

img {
    max-width: 100%;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #b8c2d8;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8d99b2;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--full-surface);
    border-right: 1px solid var(--full-border);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px 24px;
    z-index: 20;
}

.app-logo {
    display: block;
    width: 180px;
    margin-bottom: 10px;
}

.app-user-card,
.app-info-card {
    background: var(--full-soft);
    border-radius: var(--full-radius);
    padding: 16px 18px;
}

.app-kicker,
.app-label,
.field-hint {
    color: var(--full-muted);
    font-size: 13px;
    font-weight: 500;
}

.app-user-card strong,
.app-info-card strong {
    display: block;
    margin-top: 4px;
    color: var(--full-text);
    font-size: 15px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 52px;
    width: 100%;
    padding: 0 18px;
    border-radius: var(--full-radius);
    background: var(--full-soft);
    color: #06f;
    font-weight: 500;
    text-align: left;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.app-nav-link i {
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: var(--full-primary);
    color: #fff;
}

.app-nav-link:hover {
    transform: translateX(2px);
}

.app-sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-nav-link-danger:hover,
.app-nav-link-danger.active {
    background: #071438;
    color: #fff;
}

.app-main {
    min-width: 0;
    padding: 32px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
}

.app-footer {
    flex: 0 0 auto;
    width: 100%;
    max-width: 1560px;
    margin: 26px auto 0;
    color: var(--full-muted);
    font-size: 13px;
}

.app-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 18px;
    background: var(--full-surface);
    border-bottom: 1px solid var(--full-border);
}

.app-overlay {
    display: none;
}

.changelog-panel {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(430px, 92vw);
    background: var(--full-surface);
    border-left: 1px solid var(--full-border);
    box-shadow: var(--full-shadow);
    padding: 24px;
    overflow: auto;
    z-index: 40;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-head h1,
.page-head h2,
h1,
h2 {
    color: var(--full-text);
    font-weight: 700;
    letter-spacing: 0;
}

.page-head h1,
h1 {
    font-size: 28px;
    line-height: 1.25;
}

.page-head h2,
h2 {
    font-size: 22px;
    line-height: 1.3;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--full-muted);
    font-size: 14px;
}

.surface-card {
    background: var(--full-surface);
    border: 1px solid var(--full-border);
    border-radius: var(--full-radius);
    box-shadow: var(--full-shadow);
    padding: 26px;
}

.filters-card {
    background: var(--full-surface);
    border: 1px solid var(--full-border);
    border-radius: var(--full-radius);
    padding: 22px;
    margin-bottom: 24px;
}

.form-control,
.form-select,
.w3-input,
.w3-select,
select,
textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"] {
    min-height: 48px;
    border: 1px solid var(--full-border) !important;
    border-radius: 6px !important;
    color: var(--full-text);
    background-color: #fff;
    box-shadow: none !important;
    font-size: 15px;
}

textarea.form-control,
textarea.w3-input,
textarea {
    min-height: 150px;
}

.form-control:focus,
.form-select:focus,
.w3-input:focus,
.w3-select:focus,
select:focus,
textarea:focus,
input:focus {
    border-color: var(--full-primary) !important;
    box-shadow: 0 0 0 .18rem rgba(37, 132, 255, .15) !important;
    outline: 0;
}

label,
.control-label {
    color: var(--full-text);
    font-weight: 600;
    margin-bottom: 7px;
}

.form-group {
    margin-bottom: 18px;
}

.surface-card .form-group {
    width: 100%;
}

.surface-card .form-group::after {
    content: "";
    display: table;
    clear: both;
}

.surface-card .col-sm-2.control-label,
.surface-card .col-sm-2 {
    width: 20%;
    float: left;
    padding-right: 18px;
}

.surface-card .col-sm-10 {
    width: 80%;
    float: left;
}

.surface-card .col-sm-7 {
    width: 58.333333%;
    float: left;
}

.surface-card .col-sm-3 {
    width: 25%;
    float: left;
    padding-left: 12px;
}

.surface-card .col-sm-3 .form-control.btn,
.surface-card .col-sm-3 .btn {
    width: 100%;
}

.btn,
.w3-button,
button {
    min-height: 44px;
    border-radius: 6px !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
}

.btn-primary,
.w3-blue,
.w3-lime {
    background: var(--full-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.w3-blue:hover,
.w3-lime:hover {
    background: var(--full-primary-hover) !important;
    color: #fff !important;
}

.btn-success,
.w3-green {
    background: var(--full-success) !important;
    color: #fff !important;
}

.btn-danger,
.w3-red {
    background: var(--full-danger) !important;
    color: #fff !important;
}

.btn-secondary,
.w3-black,
.w3-gray,
.w3-grey {
    background: #d8e2f0 !important;
    color: var(--full-text) !important;
}

.btn-light {
    background: var(--full-soft) !important;
    color: #06f !important;
}

.table {
    width: 100%;
    color: var(--full-text);
}

.table > :not(caption) > * > * {
    padding: 15px 14px;
    border-bottom-color: #e7ecf5;
    vertical-align: middle;
}

.table thead th {
    color: var(--full-muted);
    font-weight: 600;
    border-bottom: 0;
}

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

.table-action-group {
    display: inline-flex;
    gap: 8px;
    justify-content: center;
}

.modal-content {
    border: 0;
    border-radius: var(--full-radius);
    box-shadow: 0 16px 48px rgba(15, 23, 42, .18);
}

.modal-header,
.modal-footer {
    border-color: #e7ecf5;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    background: var(--full-soft);
    color: #06f;
    font-weight: 600;
}

.empty-state {
    padding: 42px 20px;
    color: var(--full-muted);
    text-align: center;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.quick-card {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--full-surface);
    border: 1px solid var(--full-border);
    border-radius: var(--full-radius);
    box-shadow: var(--full-shadow);
    padding: 22px;
    color: var(--full-text);
}

.quick-card:hover {
    color: var(--full-text);
    border-color: #b7cdf0;
    transform: translateY(-1px);
}

.quick-card-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--full-soft);
    color: var(--full-primary);
}

.quick-card-title {
    display: block;
    margin-top: 16px;
    color: var(--full-text);
    font-size: 16px;
    font-weight: 700;
}

.quick-card-text {
    margin: 6px 0 0;
    color: var(--full-muted);
    font-size: 13px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(460px, 1fr);
    background: #fff;
}

.login-brand {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: #fff;
    background: #0b82ef;
    position: relative;
    overflow: hidden;
}

.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 28px;
    background: rgba(255, 255, 255, .07);
    transform: rotate(42deg);
}

.login-brand::before {
    top: -90px;
    left: -110px;
}

.login-brand::after {
    right: -70px;
    bottom: -130px;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    width: min(580px, 100%);
}

.login-brand img {
    width: 320px;
    margin-bottom: 72px;
}

.login-brand h1 {
    color: #fff;
    font-size: 36px;
    margin-bottom: 18px;
}

.login-brand p {
    max-width: 620px;
    color: rgba(255, 255, 255, .92);
    font-size: 18px;
    line-height: 1.6;
}

.login-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px clamp(40px, 8vw, 150px);
}

.login-form {
    width: min(620px, 100%);
}

.login-form .divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 22px;
    margin: 40px 0;
    color: var(--full-muted);
}

.login-form .divider::before,
.login-form .divider::after {
    content: "";
    height: 1px;
    background: var(--full-border);
}

.login-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.w3-hide,
.d-none {
    display: none !important;
}

.w3-right {
    float: right;
}

.w3-left {
    float: left;
}

.w3-center {
    text-align: center;
}

.w3-padding,
.w3-padding-16 {
    padding: 16px;
}

.w3-container {
    padding: 0;
}

.w3-row,
.w3-row-padding {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.w3-col,
.w3-third,
.w3-twothird {
    min-width: 0;
}

.w3-third {
    flex: 1 1 280px;
}

.w3-twothird {
    flex: 2 1 560px;
}

.w3-border-bottom {
    border-bottom: 1px solid var(--full-border);
}

.w3-pale-red {
    background: #fff5f8;
    border: 1px solid #ffd6e3;
    color: #b42347;
}

.w3-pale-yellow {
    background: #fff8dd;
    border: 1px solid #ffe08a;
    color: #7a5a00;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 0 !important;
}

.dataTables_wrapper .dt-buttons .btn,
.dataTables_wrapper .paginate_button {
    min-height: 38px;
}

@media (max-width: 991px) {
    .app-shell {
        display: block;
    }

    .app-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 30;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(310px, 86vw);
        transform: translateX(-105%);
        transition: transform .18s ease;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-overlay.is-open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 9, 30, .45);
        z-index: 15;
    }

    .app-main {
        padding: 24px 18px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: 340px;
        padding: 46px 28px;
        align-items: flex-start;
    }

    .login-brand img {
        width: 240px;
        margin-bottom: 34px;
    }

    .login-panel {
        min-height: auto;
        padding: 42px 24px;
    }

    .surface-card .col-sm-2.control-label,
    .surface-card .col-sm-2,
    .surface-card .col-sm-10,
    .surface-card .col-sm-7,
    .surface-card .col-sm-3 {
        width: 100%;
        float: none;
        padding-left: 0;
        padding-right: 0;
    }

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

@media (min-width: 992px) and (max-width: 1399px) {
    .quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
