:root {
    --forge-blue: #070b56;
    --forge-yellow: #ffd800;
    --forge-white: #ffffff;

    --shell-background: #f7f7f5;
    --shell-border: rgba(7, 11, 86, 0.10);
    --shell-muted: #747474;
    --shell-text: #161616;

    --surface: #ffffff;
    --surface-soft: #fafafa;
    --border: #e7e8ed;
    --border-soft: #ececf0;

    --text: #20232b;
    --text-soft: #707580;
    --text-muted: #898d96;

    --sidebar-width: 250px;
    --topbar-height: 76px;
}


/* =========================================================
   Reset
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background: var(--shell-background);
    color: var(--shell-text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body.sidebar-is-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}


/* =========================================================
   App Shell
   ========================================================= */

.app {
    min-height: 100vh;
    background: var(--shell-background);
}


/* =========================================================
   Sidebar
   ========================================================= */

.sidebar {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;

    display: flex;
    flex-direction: column;

    width: var(--sidebar-width);
    height: 100vh;

    padding: 32px 24px 24px;

    background: var(--forge-blue);
    color: var(--forge-white);

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}


/* =========================================================
   Brand
   ========================================================= */

.brand {
    padding: 4px 8px 42px;
}

.brand-name {
    color: var(--forge-white);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 4px;
}

.brand-business {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1.5px;
}


/* =========================================================
   Navigation
   ========================================================= */

.navigation {
    display: flex;
    flex-direction: column;
}

.navigation-label {
    margin-bottom: 11px;
    padding: 0 8px;

    color: rgba(255, 255, 255, 0.34);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;

    min-height: 43px;
    padding: 0 10px;

    border-radius: 7px;

    color: rgba(255, 255, 255, 0.68);

    font-size: 13px;
    font-weight: 500;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.nav-link:hover {
    color: var(--forge-white);
    background: rgba(255, 255, 255, 0.07);
}

.nav-link:focus-visible {
    outline: 2px solid var(--forge-yellow);
    outline-offset: 2px;
}

.nav-link.active {
    color: var(--forge-white);
    background: rgba(255, 255, 255, 0.09);
}


/* =========================================================
   Sidebar Footer
   ========================================================= */

.sidebar-footer {
    margin-top: auto;
    padding-top: 32px;
}

.sidebar-user {
    padding: 0 8px 18px;
}

.sidebar-user-name {
    color: var(--forge-white);
    font-size: 12px;
    font-weight: 700;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    margin-top: 5px;

    color: rgba(255, 255, 255, 0.38);

    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.logout-link {
    display: block;

    padding: 10px 8px;

    color: rgba(255, 255, 255, 0.42);

    font-size: 11px;
    font-weight: 600;

    transition: color 0.2s ease;
}

.logout-link:hover {
    color: var(--forge-white);
}

.logout-link:focus-visible {
    outline: 2px solid var(--forge-yellow);
    outline-offset: 2px;
}


/* =========================================================
   Main
   ========================================================= */

.main {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}


/* =========================================================
   Topbar
   ========================================================= */

.topbar {
    position: sticky;
    z-index: 50;
    top: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    height: var(--topbar-height);
    padding: 0 42px;

    background: rgba(247, 247, 245, 0.96);

    border-bottom: 1px solid var(--shell-border);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-title {
    color: var(--forge-blue);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

.topbar-date {
    color: var(--shell-muted);

    font-size: 11px;
    font-weight: 600;
}


/* =========================================================
   Mobile Menu Button
   ========================================================= */

.menu-button {
    display: none;

    width: 42px;
    height: 42px;

    padding: 0;

    border: 0;
    border-radius: 8px;

    background: transparent;

    cursor: pointer;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;
}

.menu-button span {
    display: block;

    width: 19px;
    height: 1.5px;

    background: var(--forge-blue);

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.menu-button:hover {
    background: rgba(7, 11, 86, 0.06);
}

.menu-button:focus-visible {
    outline: 2px solid var(--forge-blue);
    outline-offset: 2px;
}

.menu-button.menu-open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.menu-button.menu-open span:nth-child(2) {
    opacity: 0;
}

.menu-button.menu-open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}


/* =========================================================
   Content
   ========================================================= */

.content {
    width: 100%;
    min-width: 0;
    padding: 42px;
}


/* =========================================================
   Messages
   ========================================================= */

.messages {
    width: 100%;
    margin-bottom: 24px;
}

.message {
    padding: 13px 16px;

    border: 1px solid var(--shell-border);
    border-radius: 6px;

    background: var(--forge-white);
    color: var(--shell-text);

    font-size: 12px;
    line-height: 1.5;
}


/* =========================================================
   General Overflow Protection
   ========================================================= */

.content table {
    max-width: 100%;
}

.content img {
    max-width: 100%;
    height: auto;
}

.content pre {
    max-width: 100%;
    overflow-x: auto;
}


/* =========================================================
   Overlay
   ========================================================= */

.sidebar-overlay {
    display: none;
}


/* =========================================================
   Shared Page Header
   ========================================================= */

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 28px;

    margin-bottom: 30px;
}

.dashboard-header h1 {
    margin: 0;

    color: var(--forge-blue);

    font-size: clamp(34px, 4vw, 50px);
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -2px;
}

.dashboard-header p {
    margin-top: 11px;

    color: var(--text-soft);

    font-size: 14px;
    line-height: 1.6;
}

.dashboard-header p a {
    color: var(--forge-blue);
    font-weight: 700;
}


/* =========================================================
   Buttons
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 0 17px;

    border-radius: 7px;

    font-size: 12px;
    font-weight: 700;

    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

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

.button:focus-visible {
    outline: 2px solid var(--forge-blue);
    outline-offset: 2px;
}

.button-primary {
    border: 1px solid var(--forge-blue);

    background: var(--forge-blue);
    color: var(--forge-white);
}

.button-primary:hover {
    background: #0b106b;
    border-color: #0b106b;
}

.button-secondary {
    border: 1px solid #dcdde2;

    background: var(--forge-white);
    color: #30333b;
}

.button-secondary:hover {
    border-color: #c9cad0;
    background: #fafafa;
}


/* =========================================================
   Dashboard Sections
   ========================================================= */

.dashboard-section {
    width: 100%;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    overflow: hidden;
}

.dashboard-sections {
    display: grid;
    gap: 18px;
}


/* =========================================================
   Section Header
   ========================================================= */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 22px 24px;

    border-bottom: 1px solid var(--border-soft);
}

.section-header h2 {
    margin: 0;

    color: #171923;

    font-size: 15px;
    font-weight: 750;
    letter-spacing: -0.2px;
}

.section-header a {
    color: var(--forge-blue);

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}


/* =========================================================
   Dashboard Grid
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 18px;
}

.dashboard-card {
    min-width: 0;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;
}

.card-label {
    display: block;

    margin-bottom: 11px;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}

.dashboard-card strong {
    display: block;

    color: var(--forge-blue);

    font-size: 20px;
    font-weight: 750;
    line-height: 1.2;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   Detail Grid
   ========================================================= */

.detail-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 28px 42px;

    padding: 24px;
}

.detail-grid > div {
    min-width: 0;
}

.detail-grid .form-group-full {
    grid-column: 1 / -1;
}

.detail-grid p {
    margin: 0;

    color: #272a32;

    font-size: 14px;
    line-height: 1.7;

    overflow-wrap: anywhere;
}

.detail-grid p a {
    color: var(--forge-blue);
    font-weight: 700;
}


/* =========================================================
   Forms
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 22px 24px;

    padding: 24px;
}

.form-group {
    min-width: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: #30333b;

    font-size: 12px;
    font-weight: 700;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;

    padding: 12px 13px;

    color: #252832;
    background: var(--surface);

    border: 1px solid #dfe1e7;
    border-radius: 8px;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.form-group input,
.form-group select {
    min-height: 46px;
}

.form-group textarea {
    min-height: 125px;

    resize: vertical;

    line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--forge-blue);

    box-shadow:
        0 0 0 3px rgba(7, 11, 86, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a1a4ab;
}


/* =========================================================
   Form Errors
   ========================================================= */

.form-errors {
    margin: 24px 24px 0;

    padding: 14px 16px;

    color: #8a2020;
    background: #fff7f7;

    border: 1px solid #f0d5d5;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.5;
}

.form-errors p {
    margin: 0;
}

.field-error {
    margin-top: 7px;

    color: #a62c2c;

    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   Form Actions
   ========================================================= */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 10px;

    padding: 20px 24px;

    border-top: 1px solid var(--border-soft);
}


/* =========================================================
   Search Forms
   ========================================================= */

.search-form {
    display: grid;

    grid-template-columns: minmax(0, 1fr) 190px auto auto;

    gap: 10px;

    padding: 20px 24px;

    border-bottom: 1px solid var(--border-soft);
}

.search-form input,
.search-form select {
    width: 100%;

    min-height: 44px;

    padding: 0 13px;

    color: #272a32;
    background: var(--surface);

    border: 1px solid #dfe1e7;
    border-radius: 8px;

    font-size: 13px;

    outline: none;
}

.search-form input:focus,
.search-form select:focus {
    border-color: var(--forge-blue);

    box-shadow:
        0 0 0 3px rgba(7, 11, 86, 0.08);
}


/* =========================================================
   Tables
   ========================================================= */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.table-wrapper::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.table-wrapper table {
    width: 100%;

    min-width: 760px;

    border-collapse: collapse;
}

.table-wrapper th {
    padding: 13px 20px;

    color: var(--text-muted);
    background: var(--surface-soft);

    border-bottom: 1px solid #e8e9ed;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;

    text-align: left;
    text-transform: uppercase;

    white-space: nowrap;
}

.table-wrapper td {
    padding: 17px 20px;

    color: #3a3d45;

    border-bottom: 1px solid #eeeeF1;

    font-size: 13px;

    vertical-align: middle;
}

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

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

.table-wrapper td a {
    color: var(--forge-blue);
    font-weight: 700;
}


/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
    padding: 50px 24px;

    color: #858992;

    font-size: 13px;
    line-height: 1.6;

    text-align: center;
}

.empty-state h3 {
    margin-bottom: 8px;

    color: #20232b;

    font-size: 17px;
    font-weight: 750;
}

.empty-state p {
    margin-bottom: 20px;
}


/* =========================================================
   Login / Authentication
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px 20px;

    background: var(--forge-blue);
}

.login-card {
    width: 100%;
    max-width: 430px;

    padding: 42px;

    background: var(--surface);

    border-radius: 12px;
}

.login-header {
    margin-bottom: 34px;
}

.login-header h1 {
    color: var(--forge-blue);

    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
}

.login-header p {
    margin-top: 7px;

    color: #858992;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.login-card .section-header {
    padding: 0 0 20px;
}

.login-button {
    width: 100%;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 1100px) {

    :root {
        --sidebar-width: 220px;
    }

    .sidebar {
        padding-left: 20px;
        padding-right: 20px;
    }

    .topbar {
        padding-left: 30px;
        padding-right: 30px;
    }

    .content {
        padding: 30px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 850px) {

    .sidebar {
        width: min(300px, 82vw);

        transform: translateX(-100%);

        box-shadow:
            18px 0 45px rgba(0, 0, 0, 0.18);

        transition:
            transform 0.28s cubic-bezier(
                0.22,
                1,
                0.36,
                1
            );
    }

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

    .sidebar-overlay {
        position: fixed;
        z-index: 90;

        inset: 0;

        display: block;

        background: rgba(0, 0, 0, 0.34);

        opacity: 0;
        visibility: hidden;

        transition:
            opacity 0.25s ease,
            visibility 0.25s ease;
    }

    .sidebar-overlay.overlay-visible {
        opacity: 1;
        visibility: visible;
    }

    .main {
        margin-left: 0;
    }

    .topbar {
        height: 68px;

        padding: 0 20px;
    }

    .menu-button {
        display: flex;
    }

    .topbar-title {
        margin-left: auto;
        margin-right: 18px;
    }

    .topbar-date {
        max-width: 110px;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content {
        padding: 28px 20px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-header .button {
        width: 100%;
    }

    .search-form {
        grid-template-columns: 1fr 1fr;
    }

    .search-form input {
        grid-column: 1 / -1;
    }

    .search-form .button {
        width: 100%;
    }
}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 520px) {

    .topbar {
        padding: 0 14px;
    }

    .topbar-title {
        margin-right: 12px;

        font-size: 8px;
        letter-spacing: 1.2px;
    }

    .topbar-date {
        max-width: 82px;
        font-size: 10px;
    }

    .menu-button {
        flex: 0 0 42px;
    }

    .content {
        padding: 22px 14px;
    }

    .messages {
        margin-bottom: 18px;
    }

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

    .dashboard-card {
        padding: 20px;
    }

    .dashboard-header h1 {
        font-size: 36px;
        letter-spacing: -1.5px;
    }

    .section-header {
        padding: 20px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .form-group-full {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 18px 20px;
    }

    .form-actions .button {
        width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 22px;
    }

    .detail-grid .form-group-full {
        grid-column: auto;
    }

    .search-form {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .search-form input {
        grid-column: auto;
    }

    .search-form .button {
        width: 100%;
    }

    .empty-state {
        padding: 40px 20px;
    }

    .login-card {
        padding: 32px 24px;
    }
}


/* =========================================================
   Very Small Screens
   ========================================================= */

@media (max-width: 360px) {

    .topbar-title {
        display: none;
    }

    .topbar-date {
        margin-left: auto;
    }
}