:root {
    --theme: #0B5ED7;
}
body {
    background: #f5f7fb;
}
.theme,
.w3-hover-theme:hover {
    color: #fff !important;
    background-color: var(--theme) !important;
}
.text-theme {
    color: var(--theme) !important;
}
.btn-theme {
    color: #fff !important;
    background-color: var(--theme) !important;
}
.app-sidebar {
    width: 260px;
    top: 43px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 14px rgba(15, 23, 42, 0.06);
}
.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid #eef0f4;
    min-height: 82px;
}
.sidebar-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
}
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--theme);
    font-weight: 700;
    font-size: 18px;
}
.brand-name {
    color: #111827;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
}
.brand-subtitle {
    color: #6b7280;
    font-size: 12px;
    margin-top: 3px;
}
.sidebar-scroll {
    padding: 10px 10px 18px;
    overflow-y: auto;
    height: calc(100vh - 125px);
}
.main-content {
    margin-left: 260px;
    padding: 64px 18px 20px;
}
.card-metric {
    min-height: 118px;
    border-top: 4px solid var(--theme);
}
.table-scroll {
    overflow-x: auto;
}
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.actions-cell {
    min-width: 118px;
    vertical-align: top !important;
}
.row-actions {
    position: relative;
    display: inline-block;
}
.action-menu-button {
    min-width: 92px;
    border-radius: 6px;
}
.row-actions.is-open .action-menu-button {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme) 22%, transparent);
    filter: brightness(0.95);
}
.action-menu-button::after {
    content: "";
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    border-top: 5px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}
.row-action-menu {
    display: none;
    position: fixed;
    min-width: 170px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 1000;
}
.row-action-menu.open {
    display: block;
}
.row-action-menu a,
.row-action-menu button {
    display: block;
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.row-action-menu a:hover,
.row-action-menu button:hover,
.row-action-menu a:focus,
.row-action-menu button:focus {
    outline: none;
    background: color-mix(in srgb, var(--theme) 10%, white);
    border-left-color: var(--theme);
    color: var(--theme);
}
.row-action-menu form {
    margin: 0;
}
.row-action-menu .row-action-danger {
    color: #dc2626;
}
.row-action-menu .row-action-danger:hover {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #b91c1c;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.document-total-box {
    max-width: 380px;
    margin: 18px 0 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.document-total-box div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    border-bottom: 1px solid #eef0f4;
}
.document-total-box div:last-child {
    border-bottom: 0;
}
.document-total-box .grand {
    color: #fff;
    background: var(--theme);
    font-size: 17px;
}
.line-total {
    min-width: 100px;
    font-weight: 600;
    vertical-align: middle !important;
}
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fb;
    padding: 24px;
}
.login-hero {
    color: #fff;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}
.login-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.login-brand-row img,
.login-brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
    padding: 7px;
    color: var(--theme);
}
.login-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
}
.login-brand-row h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}
.login-brand-row p,
.login-hero-copy p {
    margin: 5px 0 0;
    opacity: 0.88;
}
.login-hero-copy {
    max-width: 560px;
}
.login-hero-copy h2 {
    font-size: 34px;
    line-height: 1.18;
    margin: 0 0 12px;
    font-weight: 700;
}
.login-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.login-trust-grid div {
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 14px;
}
.login-trust-grid strong,
.login-trust-grid span {
    display: block;
}
.login-trust-grid span {
    opacity: 0.86;
    font-size: 12px;
    margin-top: 4px;
}
.login-form-panel {
    width: 100%;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}
.login-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    padding: 34px;
}
.login-card-brand {
    text-align: center;
    margin-bottom: 26px;
}
.login-logo-frame {
    width: 86px;
    height: 86px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    padding: 10px;
}
.login-card-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.login-card-brand .login-brand-mark {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    margin: 0;
}
.login-card-brand strong,
.login-card-brand span {
    display: block;
}
.login-card-brand strong {
    color: #111827;
    font-size: 18px;
}
.login-card-brand span {
    color: #6b7280;
    font-size: 12px;
    margin-top: 3px;
}
.login-form-head {
    margin-bottom: 22px;
}
.login-kicker {
    color: var(--theme);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.login-form-head h2 {
    margin: 7px 0;
    font-size: 28px;
    color: #111827;
}
.login-form-head p,
.login-help {
    color: #6b7280;
    margin: 0;
}
.login-card label {
    display: block;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    margin: 15px 0 6px;
}
.login-input {
    width: 100%;
    height: 44px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
}
.login-input:focus {
    border-color: var(--theme);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme) 16%, transparent);
}
.login-submit {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--theme);
    font-weight: 700;
    margin-top: 20px;
    cursor: pointer;
}
.login-submit:hover {
    filter: brightness(0.96);
}
.login-alert {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    color: #7f1d1d;
    padding: 11px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
}
.login-help {
    text-align: center;
    font-size: 12px;
    margin-top: 15px;
}
.login-copyright {
    max-width: 430px;
    width: 100%;
    margin: 18px auto 0;
    text-align: center;
    color: #6b7280;
    font-size: 12px;
}
.print-page {
    background: #fff;
    max-width: 794px;
    min-height: 1123px;
    margin: 20px auto;
    padding: 34px;
    color: #111;
}
.print-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 3px solid var(--theme);
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.logo-placeholder {
    width: 110px;
    height: 80px;
    border: 1px dashed #888;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 12px;
}
.print-logo {
    width: 110px;
    max-height: 80px;
    object-fit: contain;
}
.print-signature {
    width: 180px;
    max-height: 70px;
    object-fit: contain;
    display: block;
}
.signature-block {
    width: 220px;
    margin-top: 34px;
    padding-top: 6px;
    border-top: 1px solid #333;
}
.sidebar-group {
    padding: 16px 10px 7px;
    color: #6b7280;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0;
}
.sidebar-group-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    margin-top: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: left;
}
.sidebar-group-button:hover,
.sidebar-group-button.open {
    background: color-mix(in srgb, var(--theme) 9%, white);
    color: var(--theme);
}
.sidebar-group-button.active-group {
    background: color-mix(in srgb, var(--theme) 12%, white);
    box-shadow: inset 3px 0 0 var(--theme);
}
.menu-chevron {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.18s ease;
}
.sidebar-group-button.open .menu-chevron {
    transform: rotate(90deg);
}
.submenu {
    display: none;
    padding: 2px 0 6px 10px;
    border-left: 1px solid #e5e7eb;
    margin-left: 11px;
}
.submenu.open {
    display: block;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    margin: 2px 0;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.sidebar-link:hover {
    background: #f3f6fb;
    color: var(--theme);
}
.sidebar-link.active {
    color: var(--theme);
    background: color-mix(in srgb, var(--theme) 13%, white);
    box-shadow: inset 3px 0 0 var(--theme);
    font-weight: 700;
}
.nav-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    background: #eef2f7;
    color: #4b5563;
    font-size: 11px;
    font-weight: 700;
}
.sidebar-link.active .nav-badge,
.sidebar-link:hover .nav-badge {
    color: #fff;
    background: var(--theme);
}
.signature-line {
    border-top: 1px solid #333;
    width: 220px;
    margin-top: 54px;
    padding-top: 6px;
}
.print-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    margin-top: 42px;
}
.print-footer-note {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    font-size: 12px;
    color: #555;
}
.document-items tbody td {
    color: #111 !important;
    background: #fff !important;
    vertical-align: top;
}
@media (max-width: 992px) {
    .login-form-panel {
        padding: 0;
    }
    .w3-sidebar {
        top: 0;
        display: none;
        z-index: 4;
    }
    .app-sidebar {
        width: 280px;
    }
    .main-content {
        margin-left: 0;
        padding-top: 58px;
    }
}
@media (max-width: 600px) {
    .login-card {
        padding: 24px;
    }
    .login-brand-row h1 {
        font-size: 18px;
    }
    .main-content {
        padding-left: 10px;
        padding-right: 10px;
    }
    .w3-button {
        margin-bottom: 4px;
    }
    .print-page {
        padding: 16px;
    }
    .print-header {
        display: block;
    }
    .print-footer {
        display: block;
    }
}
@media print {
    body {
        background: #fff;
    }
    .no-print,
    .w3-sidebar,
    .w3-top {
        display: none !important;
    }
    .main-content {
        margin: 0;
        padding: 0;
    }
    .print-page {
        margin: 0;
        max-width: none;
        min-height: auto;
        padding: 0;
        box-shadow: none !important;
    }
    a {
        text-decoration: none;
        color: #000;
    }
}
