:root {
    --sg-dark: #050608;
    --sg-panel: #111722;
    --sg-panel-2: #182232;
    --sg-blue: #009ee3;
    --sg-blue-dark: #004b93;
    --sg-orange: #ff8a00;
    --sg-yellow: #ffcc00;
    --sg-white: #ffffff;
    --sg-muted: #9aa7b8;
    --sg-border: rgba(255,255,255,.12);
    --sg-shadow: 0 20px 55px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(0,158,227,.26), transparent 30rem),
        radial-gradient(circle at top right, rgba(255,138,0,.18), transparent 26rem),
        var(--sg-dark);
    color: var(--sg-white);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

.sg-wrapper { display: flex; min-height: 100vh; }

.sg-sidebar {
    width: 292px;
    position: fixed;
    inset: 0 auto 0 0;
    background: rgba(5, 6, 8, .94);
    border-right: 1px solid var(--sg-border);
    padding: 20px;
    overflow-y: auto;
    z-index: 50;
    backdrop-filter: blur(14px);
}

.sg-brand {
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--sg-border);
    margin-bottom: 16px;
}

.sg-brand img {
    width: 180px;
    max-width: 100%;
    display: block;
    margin: 0 auto 8px;
}

.sg-brand span {
    font-weight: 950;
    letter-spacing: .08em;
    background: linear-gradient(90deg, var(--sg-blue), var(--sg-orange), var(--sg-yellow));
    -webkit-background-clip: text;
    color: transparent;
}

.sg-menu { display: grid; gap: 6px; }

.sg-menu-title {
    color: var(--sg-muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .12em;
    font-weight: 900;
    padding: 16px 12px 6px;
}

.sg-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #d8e7f5;
    padding: 12px 13px;
    border-radius: 15px;
    font-weight: 750;
    transition: .2s ease;
}

.sg-menu a:hover {
    background: linear-gradient(135deg, rgba(0,158,227,.24), rgba(255,138,0,.18));
    color: var(--sg-white);
}

.sg-menu a i { color: var(--sg-yellow); }

.sg-main {
    margin-left: 292px;
    flex: 1;
    min-width: 0;
}

.sg-topbar {
    min-height: 88px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--sg-border);
    background: rgba(5,6,8,.62);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(12px);
}

.sg-topbar h1 {
    margin: 0;
    line-height: 1;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    font-weight: 950;
}

.sg-topbar p {
    margin: 6px 0 0;
    color: var(--sg-muted);
    font-weight: 650;
}

.sg-userbox {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sg-userbox strong,
.sg-userbox span {
    display: block;
    text-align: right;
}

.sg-userbox span {
    color: var(--sg-yellow);
    font-size: .78rem;
    font-weight: 900;
}

.sg-mobile-toggle {
    display: none;
    border: 1px solid var(--sg-border);
    color: var(--sg-white);
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 8px 11px;
    font-size: 1.4rem;
}

.sg-content { padding: 30px; }

.sg-panel,
.sg-widget-card,
.sg-module-card,
.sg-module-tile,
.sg-action-card {
    background:
        linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
        var(--sg-panel);
    border: 1px solid var(--sg-border);
    border-radius: 28px;
    box-shadow: var(--sg-shadow);
}

.sg-panel { padding: 26px; }

.sg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.sg-panel-header h2 {
    margin: 0;
    font-weight: 950;
}

.sg-panel-header p {
    margin: 6px 0 0;
    color: var(--sg-muted);
}

.sg-widget-card {
    min-height: 145px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--sg-white);
    transition: .2s ease;
}

.sg-widget-card:hover,
.sg-module-card:hover,
.sg-module-tile:hover,
.sg-action-card:hover {
    transform: translateY(-4px);
    color: var(--sg-white);
    border-color: rgba(255,204,0,.50);
}

.sg-widget-card span {
    color: var(--sg-muted);
    font-weight: 800;
}

.sg-widget-card strong {
    display: block;
    font-size: 2.8rem;
    line-height: 1;
    margin-top: 8px;
    font-weight: 950;
}

.sg-widget-card i,
.sg-module-card i,
.sg-module-tile i,
.sg-big-icon,
.sg-action-card i {
    background: linear-gradient(135deg, var(--sg-blue), var(--sg-blue-dark));
    color: var(--sg-white);
    display: grid;
    place-items: center;
    box-shadow: 0 15px 30px rgba(0,158,227,.25);
}

.sg-widget-card i {
    width: 62px;
    height: 62px;
    border-radius: 22px;
    font-size: 1.9rem;
}

.sg-module-card {
    display: block;
    color: var(--sg-white);
    min-height: 210px;
    padding: 22px;
    transition: .2s ease;
}

.sg-module-card i,
.sg-module-tile i {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.sg-module-card h3,
.sg-module-tile h2 {
    font-weight: 950;
    margin: 0 0 8px;
}

.sg-module-card p,
.sg-module-tile p {
    color: var(--sg-muted);
    margin: 0 0 12px;
}

.sg-module-card span,
.sg-module-tile span {
    color: var(--sg-yellow);
    font-weight: 900;
}

.sg-module-tile {
    display: block;
    color: var(--sg-white);
    padding: 24px;
    min-height: 255px;
}

.sg-big-icon {
    width: 82px;
    height: 82px;
    border-radius: 28px;
    font-size: 2.4rem;
}

.sg-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    color: var(--sg-white);
    min-height: 94px;
}

.sg-action-card i {
    width: 48px;
    height: 48px;
    border-radius: 17px;
}

.sg-table {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255,255,255,.08);
}

.form-control,
.form-select {
    background-color: rgba(255,255,255,.07);
    color: var(--sg-white);
    border: 1px solid rgba(255,255,255,.14);
    min-height: 45px;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(255,255,255,.10);
    color: var(--sg-white);
    border-color: var(--sg-yellow);
    box-shadow: 0 0 0 .25rem rgba(255,204,0,.15);
}

.form-label {
    color: var(--sg-muted);
    font-weight: 800;
}

.btn-warning {
    --bs-btn-bg: var(--sg-yellow);
    --bs-btn-border-color: var(--sg-yellow);
    --bs-btn-color: #101010;
    --bs-btn-hover-bg: var(--sg-orange);
    --bs-btn-hover-border-color: var(--sg-orange);
    --bs-btn-hover-color: #101010;
    font-weight: 900;
}

.sg-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.sg-login-card {
    width: min(100%, 465px);
    padding: 34px;
    border-radius: 32px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025)),
        var(--sg-panel);
    border: 1px solid var(--sg-border);
    box-shadow: var(--sg-shadow);
    text-align: center;
}

.sg-login-logo {
    width: 250px;
    max-width: 100%;
    margin-bottom: 12px;
}

.sg-login-card h1 {
    font-weight: 950;
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--sg-blue), var(--sg-orange), var(--sg-yellow));
    -webkit-background-clip: text;
    color: transparent;
}

.sg-login-card p {
    color: var(--sg-muted);
    margin-bottom: 24px;
}

.sg-login-card form { text-align: left; }

@media (max-width: 991.98px) {
    .sg-sidebar {
        transform: translateX(-100%);
        transition: .25s ease;
    }

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

    .sg-main { margin-left: 0; }

    .sg-mobile-toggle { display: inline-flex; }

    .sg-topbar,
    .sg-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .sg-userbox div { display: none; }
}

@media (max-width: 575.98px) {
    .sg-topbar { min-height: 76px; }

    .sg-content { padding-top: 20px; }

    .sg-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .sg-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .sg-widget-card {
        min-height: 118px;
        padding: 18px;
        border-radius: 22px;
    }

    .sg-widget-card strong { font-size: 2.25rem; }

    .table-responsive { font-size: .9rem; }
}
