:root {
    --oct-bg: #151f2c;
    --oct-bg-soft: #182433;
    --oct-sidebar: #182433;
    --oct-card: #1f2d3d;
    --oct-card-soft: #223244;
    --oct-border: #2b3b4e;

    --oct-text: #f1f5f9;
    --oct-text-soft: #d5dde7;
    --oct-muted: #8b9bad;

    --oct-primary: #4299e1;
    --oct-primary-hover: #3182ce;
    --oct-success: #2fb344;
    --oct-danger: #d63939;
    --oct-warning: #f59f00;

    --oct-sidebar-width: 260px;
}

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

body {
    margin: 0;
    color: var(--oct-text);
    background: var(--oct-bg);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    overflow-x: hidden;
}

a {
    color: inherit;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar-wrapper {
    width: var(--oct-sidebar-width);
    flex: 0 0 var(--oct-sidebar-width);
    background: var(--oct-sidebar);
    border-right: 1px solid var(--oct-border);
}

.sidebar-wrapper aside {
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 40px;
    background: var(--oct-bg);
}

.octopus-card {
    background: var(--oct-card);
    border: 1px solid var(--oct-border);
    border-radius: 10px;
    box-shadow: none;
}

.btn-octopus {
    color: #fff;
    border-color: var(--oct-primary);
    background: var(--oct-primary);
    font-weight: 600;
}

.btn-octopus:hover,
.btn-octopus:focus {
    color: #fff;
    border-color: var(--oct-primary-hover);
    background: var(--oct-primary-hover);
}

.form-label {
    color: var(--oct-text-soft);
}

.form-control,
.form-select {
    color: var(--oct-text);
    border-color: var(--oct-border);
    background: #182433;
}

.form-control::placeholder {
    color: #6f8093;
}

.form-control:focus,
.form-select:focus {
    color: var(--oct-text);
    border-color: #5aa7e8;
    background: #182433;
    box-shadow: 0 0 0 .25rem rgba(66, 153, 225, .12);
}

.form-select option {
    color: var(--oct-text);
    background: #182433;
}

.text-secondary,
.text-muted {
    color: var(--oct-muted) !important;
}

/* Sidebar */
.sidebar-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 18px 14px !important;
    background: transparent;
}


.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin: 0;
}

.sidebar-brand-title {
    font-size: 20px;
}

.sidebar-brand-subtitle {
    font-size: 12px;
}

.sidebar-brand-block {
    gap: 14px;
    padding: 8px 8px 20px;
}

.sidebar-section-title {
    padding: 16px 10px 6px;
    color: #718096;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sidebar-nav {
    gap: 4px !important;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 11px;
    color: #bac5d2;
    border: 0;
    border-radius: 7px;
    text-decoration: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: #223244;
}

.sidebar-link.active {
    color: #fff;
    background: rgba(66, 153, 225, .16);
    box-shadow: inset 3px 0 0 var(--oct-primary);
    font-weight: 600;
}

.sidebar-link.disabled {
    color: #627286;
    pointer-events: none;
}

.sidebar-link-danger {
    margin-top: 18px;
    color: #f18d8d;
}

.sidebar-link-danger:hover {
    color: #fff;
    background: rgba(214, 57, 57, .14);
}

.sidebar-icon {
    width: 20px;
    display: inline-flex;
    justify-content: center;
    font-size: 16px;
}

/* Mobile */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border-bottom: 1px solid var(--oct-border);
    background: rgba(24, 36, 51, .96);
    backdrop-filter: blur(8px);
}

.mobile-menu-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--oct-text);
    border: 1px solid var(--oct-border);
    border-radius: 7px;
    background: #1f2d3d;
    font-size: 20px;
    line-height: 1;
}

.mobile-menu-button:hover {
    background: #26374a;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--oct-text);
    font-size: 16px;
    font-weight: 700;
}

.mobile-brand-logo {
    width: 29px;
    height: 29px;
    object-fit: contain;
}

.mobile-offcanvas {
    width: 270px !important;
    color: var(--oct-text);
    background: var(--oct-sidebar);
    border-right: 1px solid var(--oct-border);
}

.mobile-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--oct-border);
}

.mobile-offcanvas .octopus-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.mobile-offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Login */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 0%, rgba(66,153,225,.09), transparent 30%),
        var(--oct-bg);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 32px;
}

.auth-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.auth-title {
    margin: 0;
    color: var(--oct-text);
    font-size: 24px;
    font-weight: 700;
}

.auth-subtitle {
    margin-top: 6px;
    color: var(--oct-muted);
    font-size: 13px;
}

.alert-danger {
    color: #ffc9c9;
    border-color: rgba(214,57,57,.28);
    background: rgba(214,57,57,.12);
}

@media (max-width: 991.98px) {
    .app-layout {
        display: block;
        min-height: auto;
    }

    .main-content {
        width: 100%;
        padding: 20px 16px 30px;
    }

    .sidebar-brand-block {
        padding-top: 10px;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 16px 10px 24px;
    }

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        padding: 24px 20px;
    }
}