:root {
    --bg-page: #f4f7fb;
    --bg-panel: #ffffff;
    --bg-sidebar-start: #0b132b;
    --bg-sidebar-end: #12355b;
    --primary: #0f7b6c;
    --primary-soft: #d6f5f0;
    --secondary: #f3a712;
    --text-main: #17324d;
    --text-soft: #6b7a90;
    --border: #dfe6ef;
    --shadow: 0 20px 45px rgba(17, 31, 59, 0.08);
}

body {
    font-family: "Poppins", sans-serif;
    background: linear-gradient(180deg, #eef4fb 0%, var(--bg-page) 100%);
    color: var(--text-main);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(243, 167, 18, 0.25), transparent 30%),
        radial-gradient(circle at bottom right, rgba(15, 123, 108, 0.3), transparent 35%),
        linear-gradient(135deg, #0b132b 0%, #153e75 55%, #0f7b6c 100%);
}

.login-card {
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
}

.login-panel {
    display: flex;
    align-items: center;
    padding: 3rem;
    color: #fff;
    background:
        linear-gradient(160deg, rgba(8, 15, 36, 0.92), rgba(20, 53, 89, 0.88)),
        linear-gradient(45deg, #0f7b6c, #f3a712);
}

.eyebrow {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-highlights {
    display: grid;
    gap: 0.85rem;
}

.demo-box {
    padding: 1rem 1.1rem;
    background: #f6f9fc;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-soft);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px 1fr;
    transition: grid-template-columns 0.25s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 96px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 1.4rem 1rem;
    background:
        linear-gradient(180deg, var(--bg-sidebar-start) 0%, var(--bg-sidebar-end) 100%);
    color: #fff;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.brand small {
    color: rgba(255, 255, 255, 0.7);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3a712, #0f7b6c);
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    color: rgba(255, 255, 255, 0.82);
    border-radius: 16px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.sidebar-section {
    display: grid;
    gap: 0.35rem;
}

.sidebar-section-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    justify-content: space-between;
    text-align: left;
}

.sidebar-link-main {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-chevron {
    transition: transform 0.2s ease;
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 0.45rem;
    padding-left: 0.8rem;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.72rem 0.9rem 0.72rem 1.1rem;
    color: rgba(255, 255, 255, 0.74);
    border-radius: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.sidebar-sublink:hover,
.sidebar-sublink.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border-left-color: rgba(255, 255, 255, 0.35);
    transform: translateX(2px);
}

.app-shell.sidebar-collapsed .sidebar-link span,
.app-shell.sidebar-collapsed .sidebar-link-main span,
.app-shell.sidebar-collapsed .sidebar-sublink span,
.app-shell.sidebar-collapsed .sidebar-chevron,
.app-shell.sidebar-collapsed .brand strong,
.app-shell.sidebar-collapsed .brand small {
    display: none;
}

.app-shell.sidebar-collapsed .brand {
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-section-toggle,
.app-shell.sidebar-collapsed .sidebar-sublink {
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-submenu {
    padding-left: 0;
}

.content-wrap {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(223, 230, 239, 0.85);
    backdrop-filter: blur(12px);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-bell {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.notification-menu {
    width: min(360px, 92vw);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
}

.notification-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid #edf2f7;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover {
    background: #f8fbfe;
}

.notification-icon {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef4fb;
}

.notification-empty {
    padding: 1.1rem 1rem;
    color: var(--text-soft);
}

.page-content {
    padding: 1.5rem;
}

.card {
    border: 1px solid rgba(223, 230, 239, 0.95);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.metric-card {
    overflow: hidden;
    color: #fff;
}

.metric-card .card-body {
    padding: 1.35rem;
}

.metric-label {
    display: inline-block;
    margin-bottom: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
}

.metric-sales { background: linear-gradient(135deg, #0f7b6c, #0fb78d); }
.metric-expenses { background: linear-gradient(135deg, #cc7a00, #f3a712); }
.metric-profit { background: linear-gradient(135deg, #164e63, #2c7da0); }
.metric-target { background: linear-gradient(135deg, #5a189a, #9d4edd); }

.surface-soft {
    background: #f8fbfe;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.table-responsive {
    border-radius: 18px;
}

.table > :not(caption) > * > * {
    padding: 0.85rem 0.8rem;
    vertical-align: middle;
}

.form-control,
.form-select {
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    border-color: #d4dde9;
}

.btn {
    border-radius: 14px;
    padding: 0.7rem 1rem;
    font-weight: 600;
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: #0d665a;
    border-color: #0d665a;
}

.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.list-toolbar .form-control,
.list-toolbar .form-select {
    min-width: 170px;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-soft);
}

.product-thumb,
.product-thumb-lg,
.pos-product-image {
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #edf4fb;
}

.product-thumb {
    width: 64px;
    height: 64px;
}

.product-thumb-lg {
    width: 120px;
    height: 120px;
}

.product-image-button {
    padding: 0;
    border: 0;
    background: transparent;
}

.product-image-inline {
    display: block;
    width: 100%;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.pos-product-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.pos-product-image {
    width: 100%;
    height: 170px;
    border-radius: 0;
    border: 0;
}

.pos-product-body {
    padding: 1rem;
}

.chart-card {
    position: relative;
    min-height: 340px;
}

.chart-wrap {
    position: relative;
    height: 280px;
}

.insight-banner {
    border-radius: 24px;
    padding: 1.25rem 1.35rem;
    background:
        linear-gradient(135deg, rgba(15, 123, 108, 0.12), rgba(44, 125, 160, 0.08)),
        #fff;
    border: 1px solid rgba(15, 123, 108, 0.16);
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.print-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.print-page {
    background: #fff;
}

.print-hero {
    border-radius: 28px;
    padding: 1.8rem;
    color: #fff;
    background: linear-gradient(135deg, #0b132b 0%, #12355b 45%, #0f7b6c 100%);
    box-shadow: var(--shadow);
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.print-metric {
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.print-block {
    margin-top: 1.25rem;
    padding: 1.25rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: var(--shadow);
}

.print-table {
    width: 100%;
    border-collapse: collapse;
}

.print-table th,
.print-table td {
    padding: 0.7rem 0.55rem;
    border-bottom: 1px solid #e9eef5;
    text-align: left;
    font-size: 0.94rem;
}

.print-table th.text-end,
.print-table td.text-end {
    text-align: right;
}

.print-muted {
    color: var(--text-soft);
}

@media (max-width: 991.98px) {
    .chart-wrap {
        height: 240px;
    }

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

@media (max-width: 991.98px) {
    .app-shell,
    .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        position: relative;
    }

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

    .page-content,
    .topbar {
        padding: 1rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .no-print {
        display: none !important;
    }

    .print-shell {
        max-width: none;
        padding: 0;
    }

    .print-block,
    .print-metric,
    .print-hero {
        box-shadow: none;
        break-inside: avoid;
    }

    .chart-wrap {
        height: 260px;
    }
}
