:root {
    --brand-900: #0f172a;
    --brand-800: #172554;
    --brand-700: #1d4ed8;
    --brand-600: #2563eb;
    --brand-500: #3b82f6;
    --brand-100: #dbeafe;
    --accent-gold: #f59e0b;
    --accent-emerald: #059669;
    --accent-red: #dc2626;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --surface-muted: #f8fafc;
    --border-soft: rgba(148, 163, 184, 0.22);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-soft: 0 22px 60px rgba(15, 23, 42, 0.12);
    --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.09);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --sidebar-width: 302px;
}

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

body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 25%),
        radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.1), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    color: var(--text-main);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body.guest-shell {
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.15), transparent 20%),
        radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.18), transparent 22%),
        linear-gradient(135deg, #e7efff 0%, #f7fbff 45%, #eef6ff 100%);
}

body.authenticated-shell {
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px);
}

.card:hover {
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.14);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
    padding: 1.25rem 1.35rem !important;
}

.btn {
    border-radius: 999px !important;
    padding: 0.7rem 1.35rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, var(--accent-emerald));
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    border: none;
    color: #fff;
}

.btn-warning {
    border: none;
}

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

.form-control,
.form-select {
    border-radius: 16px !important;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.95);
    padding: 0.85rem 1rem;
    color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 800;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.table tbody td {
    border-color: rgba(148, 163, 184, 0.13);
}

.alert {
    border: none;
    border-radius: 18px;
}

.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 1.35rem 1rem 1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(23, 37, 84, 0.96));
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -24px 0 60px rgba(15, 23, 42, 0.22);
    overflow-y: auto;
    z-index: 1040;
}

.sidebar-brand-block {
    margin-bottom: 1rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    color: #fff;
    padding: 0.4rem;
}

.sidebar-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.sidebar-logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    color: #fff;
}

.sidebar-company-name {
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.5;
}

.sidebar-company-subtitle {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.84rem;
}

.sidebar-user-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 1rem;
    color: #fff;
    margin-bottom: 1rem;
}

.sidebar-user-name {
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.sidebar-user-role {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    margin: 1rem 0 0.6rem;
    padding: 0 0.6rem;
    font-weight: 800;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: rgba(255, 255, 255, 0.86);
    padding: 0.9rem 1rem;
    border-radius: 18px;
    transition: 0.25s ease;
    position: relative;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(37, 99, 235, 0.38));
    color: #fff;
    transform: translateX(-4px);
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    right: 0;
    top: 16%;
    width: 4px;
    height: 68%;
    border-radius: 999px;
    background: var(--accent-gold);
}

.sidebar-badge {
    margin-inline-start: auto;
    min-width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}

.sidebar-footer-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.logout-link {
    color: #ffd089;
}

.app-main.with-sidebar {
    margin-right: calc(var(--sidebar-width) + 22px);
    padding: 1.6rem 1.2rem;
}

.main-content-container {
    max-width: 100%;
}

.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 16px !important;
    border: 0;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    color: #fff;
    z-index: 1060;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
}

.guest-main {
    padding: 2rem;
}

.login-shell {
    min-height: calc(100vh - 4rem);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, 420px);
    gap: 1.5rem;
    align-items: stretch;
}

.login-visual-card,
.login-form-card {
    border-radius: 32px;
    overflow: hidden;
}

.login-visual-card {
    position: relative;
    min-height: 620px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
}

.login-slider {
    position: absolute;
    inset: 0;
}

.login-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.9s ease;
    background-size: cover;
    background-position: center;
}

.login-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18), rgba(15, 23, 42, 0.72));
}

.login-slide.active {
    opacity: 1;
}

.login-slide-placeholder {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.35), transparent 24%),
        linear-gradient(140deg, #0f172a 0%, #1d4ed8 55%, #38bdf8 100%);
}

.login-overlay-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 2.3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    font-weight: 700;
    width: fit-content;
}

.login-headline {
    font-size: clamp(2rem, 4vw, 3.6rem);
    font-weight: 900;
    line-height: 1.18;
    margin-bottom: 0.9rem;
}

.login-description {
    color: rgba(255, 255, 255, 0.84);
    max-width: 32rem;
    font-size: 1.05rem;
    line-height: 1.9;
}

.login-slider-dots {
    display: flex;
    gap: 0.55rem;
    justify-content: flex-start;
}

.login-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    border: 0;
    padding: 0;
}

.login-slider-dot.active {
    width: 34px;
    background: #fff;
}

.login-form-card .card-body {
    padding: 2rem;
}

.login-form-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 0.55rem;
}

.login-form-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.8;
}

.login-brand-mini {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.25rem;
}

.login-brand-mini img,
.login-brand-fallback {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    object-fit: cover;
}

.login-brand-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
}

.login-note {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.settings-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.settings-media-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-card);
}

.settings-media-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.settings-media-body {
    padding: 1rem;
}

.revision-comment-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #fff;
}

.owner-comment {
    border-inline-end: 5px solid var(--accent-red);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(255, 255, 255, 0.95));
}

.employee-comment {
    border-inline-end: 5px solid var(--brand-600);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.95));
}

.bg-white-smoke {
    background: #fcfdff;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.45);
}

@media (max-width: 1200px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual-card {
        min-height: 420px;
    }
}

@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

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

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

    .app-main.with-sidebar {
        margin-right: 0;
        padding-top: 4.8rem;
    }

    .sidebar-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .guest-main {
        padding: 1rem;
    }
}

@media (min-width: 993px) {
    .sidebar-overlay {
        display: none;
    }
}

@media (max-width: 576px) {
    .login-overlay-content,
    .login-form-card .card-body {
        padding: 1.25rem;
    }

    .login-visual-card {
        min-height: 340px;
    }

    .sidebar-company-name {
        font-size: 0.94rem;
    }
}
