:root {
    --red: #dc2626;
    --red-700: #b91c1c;
    --red-800: #991b1b;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --ink: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f4f5f7;
    --dark: #14161b;
    --dark-2: #0e1013;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 17, 21, .05);
    --shadow: 0 1px 3px rgba(15, 17, 21, .07);
    --shadow-lg: 0 10px 25px rgba(15, 17, 21, .1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
}

body.ps-body {
    background: var(--bg);
    overflow-x: hidden;
}

a {
    color: var(--red);
    transition: color .15s ease;
}

a:hover {
    color: var(--red-700);
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: var(--ink);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.ps-shell {
    display: flex;
    min-height: 100vh;
}

.ps-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    z-index: 100;
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 2px 0 16px rgba(0, 0, 0, .2);
}

.ps-sidebar a {
    color: inherit;
    text-decoration: none;
}

body.ps-sidebar-open .ps-sidebar {
    transform: none;
}

@media (min-width: 992px) {
    .ps-sidebar {
        transform: none;
    }
}

.ps-brand {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
}

.ps-brand a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ps-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: 18px;
    flex: none;
    box-shadow: 0 4px 10px rgba(220, 38, 38, .35);
}

.ps-brand-text {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    letter-spacing: 1.5px;
    font-size: 15px;
    color: #fff;
    line-height: 1.2;
}

.ps-brand-text .ps-brand-dot {
    color: var(--red);
}

.ps-brand-sub {
    font-size: 10px;
    color: #8b93a3;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.ps-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 10px 24px;
}

.ps-nav-group {
    margin-bottom: 4px;
}

.ps-nav-group > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    user-select: none;
    transition: background .15s, color .15s;
}

.ps-nav-group > a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.ps-nav-group > a > i.fa {
    width: 20px;
    text-align: center;
    color: var(--red);
    font-size: 14px;
    flex: none;
}

.ps-nav-group > a .ps-chev {
    margin-left: auto;
    font-size: 11px;
    color: #8b93a3;
    transition: transform .2s;
}

.ps-nav-group.open > a .ps-chev {
    transform: rotate(180deg);
}

.ps-submenu {
    list-style: none;
    margin: 4px 0 8px;
    padding: 0 0 0 8px;
    display: none;
}

.ps-submenu.w3-show {
    display: block;
}

.ps-submenu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 7px;
    color: #9aa4b2;
    font-size: 13px;
    font-weight: 500;
    border-left: 2px solid transparent;
    transition: background .15s, color .15s;
}

.ps-submenu li a::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #4b5563;
    flex: none;
    transition: background .15s;
}

.ps-submenu li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

.ps-submenu li a:hover::before {
    background: var(--red);
}

.ps-submenu li a.active {
    color: #fff;
    background: rgba(220, 38, 38, .15);
    border-left-color: var(--red);
}

.ps-submenu li a.active::before {
    background: var(--red);
}

.ps-sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 11px;
    color: #64748b;
    letter-spacing: 1px;
    text-align: center;
}

.ps-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 21, .55);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}

body.ps-sidebar-open .ps-scrim {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .ps-scrim {
        display: none;
    }
}

.ps-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .ps-main {
        margin-left: 264px;
    }
}

.ps-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.ps-burger {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--ink);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    margin-right: 8px;
}

.ps-burger:hover {
    background: #f3f4f6;
}

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

.ps-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.ps-greet {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
}

.ps-greet b {
    color: var(--ink);
    font-weight: 600;
}

.ps-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex: none;
}

.ps-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    background: var(--red);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: background .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .25);
}

.ps-logout:hover {
    background: var(--red-700);
    color: #fff !important;
}

.ps-logout-ghost {
    background: #fff;
    color: var(--ink) !important;
    border: 1px solid var(--border);
    box-shadow: none;
}

.ps-logout-ghost:hover {
    background: #f9fafb;
    color: var(--ink) !important;
}

.ps-content {
    padding: 26px 24px 40px;
    flex: 1;
}

.ps-page-title {
    margin: 0 0 20px;
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    padding-left: 14px;
    border-left: 4px solid var(--red);
    line-height: 1.3;
}

.ps-content .w3-container.w3-large.w3-padding-16 {
    border-left: 4px solid var(--red);
    padding: 4px 0 4px 14px;
    margin: 0 0 20px;
}

.ps-content .w3-container.w3-large.w3-padding-16 b {
    font-size: 19px;
    color: var(--ink);
}

@media (max-width: 991px) {
    .ps-content {
        padding: 18px 14px 32px;
    }
}

.w3-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.w3-panel.w3-left-align {
    text-align: left;
}

.w3-panel.w3-right-align {
    text-align: right;
}

.w3-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    background: #f3f4f6;
    cursor: pointer;
    text-decoration: none !important;
    transition: all .15s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.w3-button:hover {
    background: #e5e7eb;
    color: var(--ink);
}

.w3-button:active {
    transform: translateY(1px);
}

.w3-button.w3-blue {
    background: var(--red);
    color: #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .25);
}

.w3-button.w3-blue:hover {
    background: var(--red-700);
    color: #fff;
    box-shadow: 0 3px 10px rgba(220, 38, 38, .35);
}

.w3-button.w3-red {
    background: var(--red-700);
    color: #fff;
    box-shadow: 0 2px 6px rgba(185, 28, 28, .25);
}

.w3-button.w3-red:hover {
    background: var(--red-800);
    color: #fff;
}

.w3-button.w3-white {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink);
}

.w3-button.w3-white:hover {
    background: #f9fafb;
    color: var(--ink);
}

.w3-button .fa {
    margin-right: 2px;
}

.w3-round-large {
    border-radius: 8px;
}

.w3-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.w3-table thead th {
    background: #f8f9fb;
    color: var(--muted);
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.w3-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
    font-size: 13.5px;
    color: #374151;
}

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

.w3-table tbody tr {
    transition: background .12s;
}

.w3-table tbody tr:hover {
    background: var(--red-50);
}

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

.w3-table.w3-striped tbody tr:nth-child(even):hover {
    background: var(--red-50);
}

.w3-table a {
    color: var(--red);
    font-weight: 500;
    text-decoration: none;
}

.w3-table a:hover {
    text-decoration: underline;
}

.w3-table thead .w3-border-top,
.w3-table thead .w3-border-bottom {
    border: none !important;
}

.w3-card,
.w3-card-2,
.w3-card-4 {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.w3-card-4 {
    box-shadow: var(--shadow-lg);
}

.w3-tag,
.w3-badge {
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
    display: inline-block;
}

.w3-red.w3-tag,
.w3-red.w3-badge {
    background: var(--red);
}

.w3-blue.w3-tag,
.w3-blue.w3-badge {
    background: var(--red);
}

.form-control,
.w3-input,
.w3-select {
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13.5px;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-shadow: none;
    font-family: inherit;
}

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

.form-control:focus,
.w3-input:focus,
.w3-select:focus {
    border-color: var(--red);
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .13);
}

.form-control[readonly],
.w3-input[readonly] {
    background: #f9fafb;
    color: var(--muted);
    cursor: not-allowed;
}

.w3-select {
    padding: 0 36px 0 14px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

label {
    font-size: 12.5px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
    display: block;
}

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

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.input-group {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 6px;
}

.input-group .form-control {
    border-radius: 8px 0 0 8px;
    width: 170px;
    margin: 0;
}

.input-group-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 9px 12px;
    color: var(--muted);
    font-size: 13px;
}

.input-group-addon .glyphicon {
    top: 0;
}

.input-group .input-group-addon:last-child {
    border-radius: 0 8px 8px 0;
}

.w3-display-container {
    position: relative;
}

.w3-display-container > .w3-display-right {
    position: static;
    float: right;
}

.modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 20px 50px rgba(15, 17, 21, .25);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-header h4 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: var(--ink);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px 20px;
}

.modal-backdrop.in {
    opacity: .55;
}

.w3-modal {
    z-index: 1050;
}

.w3-modal-content {
    border-radius: 14px;
    border: none;
    box-shadow: 0 20px 50px rgba(15, 17, 21, .25);
}

.pagination {
    margin: 20px 0 0;
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}

.pagination > li {
    display: inline-block;
}

.pagination > li > a,
.pagination > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
}

.pagination > li > a:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-50);
}

.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > span,
.pagination > .active > span:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    font-weight: 600;
}

.pagination > .disabled > span,
.pagination > .disabled > a {
    opacity: .5;
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

.pagination > li > a:focus,
.pagination > li > span:focus {
    outline: none;
}

.card {
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    background: #fff;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    color: var(--ink);
    padding: 14px 20px;
    border-radius: 14px 14px 0 0;
}

.card-body {
    padding: 20px;
}

.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 13.5px;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: var(--red-50);
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.btn {
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all .15s;
}

.btn-primary {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--red-700);
    border-color: var(--red-700);
    color: #fff;
}

.btn-link {
    color: var(--red);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--red-700);
    text-decoration: underline;
}

body.ps-auth {
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(220, 38, 38, .3), transparent 60%),
        radial-gradient(700px 420px at -10% 110%, rgba(220, 38, 38, .16), transparent 55%),
        linear-gradient(150deg, #101216 0%, #171a21 55%, #0c0e11 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

.ps-auth-wrap {
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.ps-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.ps-auth-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: 22px;
    box-shadow: 0 6px 16px rgba(220, 38, 38, .45);
}

.ps-auth-name {
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    letter-spacing: 2px;
    font-size: 18px;
    line-height: 1.2;
}

.ps-auth-name .ps-brand-dot {
    color: var(--red);
}

.ps-auth-sub {
    color: #8b93a3;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 3px;
}

.ps-auth-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    padding: 34px 34px 28px;
    border-top: 4px solid var(--red);
}

.ps-auth .card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.ps-auth .card-header {
    background: transparent;
    border-bottom: none;
    padding: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 20px;
    text-align: center;
}

.ps-auth .card-body {
    padding: 0;
}

.ps-auth .row {
    display: block;
    margin: 0;
}

.ps-auth [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    float: none;
    margin: 0 !important;
    padding: 0;
}

.ps-auth .text-md-end,
.ps-auth .text-end {
    text-align: left;
}

.ps-auth label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.ps-auth .form-control {
    height: 44px;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14px;
    border: 1.5px solid #d1d5db;
    margin-bottom: 14px;
}

.ps-auth .form-control:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

.ps-auth .form-check {
    margin: 4px 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-auth .form-check-input {
    width: 17px;
    height: 17px;
    accent-color: var(--red);
    margin: 0;
}

.ps-auth .form-check-label {
    margin: 0;
    font-weight: 400;
}

.ps-auth .btn-primary {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    background: var(--red);
    border: none;
    box-shadow: 0 6px 14px rgba(220, 38, 38, .35);
}

.ps-auth .btn-primary:hover {
    background: var(--red-700);
}

.ps-auth .btn-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    width: 100%;
}

.ps-auth .invalid-feedback {
    color: var(--red);
    font-size: 12.5px;
    margin: -8px 0 10px;
}

.ps-auth .alert {
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.ps-auth-footer {
    text-align: center;
    color: #8b93a3;
    font-size: 12px;
    margin-top: 24px;
    letter-spacing: 1px;
}

@media (max-width: 991px) {
    .ps-content .w3-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .ps-topbar {
        padding: 0 14px;
    }
}

/* Filter bar UI (improve/filter-ui) */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}
.filter-bar .filter-field {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-width: 0;
}
.filter-bar label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 4px;
    white-space: nowrap;
}
.filter-bar .form-control {
    width: auto;
    min-width: 110px;
    max-width: 180px;
    font-size: 12.5px;
    padding: 5px 9px;
    height: 32px;
}
.filter-bar select.form-control {
    min-width: 110px;
}
.filter-bar .input-group {
    width: auto;
    flex-wrap: nowrap;
    max-width: 210px;
    margin: 0;
}
.filter-bar .input-group .form-control {
    min-width: 110px;
}
.filter-bar .input-group .input-group-addon {
    padding: 4px 9px;
    font-size: 12px;
}
.filter-bar .filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    padding-bottom: 2px;
}
.filter-bar .filter-actions .w3-button {
    font-size: 12.5px;
    padding: 5px 14px;
}