:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4895ef;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-lighter: #f8f9fa;
    --sidebar-width: 250px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fafafa;
    color: #333;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
}

html[data-theme='dark'] body {
    background-color: #0b1220;
    color: #e2e8f0;
}

html[data-theme='dark'] .office-container,
html[data-theme='dark'] .cube-face,
html[data-theme='dark'] .stats-side-card,
html[data-theme='dark'] .stat-card {
    background-color: #111827;
    border-color: rgba(148, 163, 184, 0.26);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.38);
}

html[data-theme='dark'] .office-header,
html[data-theme='dark'] .stats-grid,
html[data-theme='dark'] .company-overview-section {
    border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme='dark'] .company-overview-section {
    background: linear-gradient(to bottom, #111827, #0f172a);
}

html[data-theme='dark'] .company-header-text h1,
html[data-theme='dark'] .stat-info h3,
html[data-theme='dark'] .summary-value,
html[data-theme='dark'] .company-summary-item,
html[data-theme='dark'] .user-meta-name {
    color: #e2e8f0;
}

html[data-theme='dark'] .company-code-header,
html[data-theme='dark'] .stat-info p,
html[data-theme='dark'] .summary-label,
html[data-theme='dark'] .company-summary-bio {
    color: #94a3b8;
}

html[data-theme='dark'] .user-profile-block,
html[data-theme='dark'] .company-summary-item,
html[data-theme='dark'] .company-summary-bio {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme='dark'] .btn-edit-company {
    background: #0f172a;
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme='dark'] .btn-edit-company:hover {
    color: #93c5fd;
    border-color: #60a5fa;
}

.company-switch-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    display: grid;
    place-items: center;
    padding: 18px;
    z-index: 4000;
}

.company-switch-modal[hidden] {
    display: none !important;
}

.company-switch-panel {
    width: min(480px, calc(100vw - 32px));
    max-height: min(82vh, 760px);
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    color: #0f172a;
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
}

.company-switch-panel-header {
    padding: 22px 22px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.company-switch-eyebrow {
    margin: 0 0 8px;
    color: #0284c7;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.company-switch-panel-header h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.company-switch-subtitle {
    margin: 10px 0 0;
    max-width: 100%;
    color: #64748b;
    font-size: 13px;
}

.company-switch-close {
    border: 0;
    background: #eff6ff;
    color: #0f172a;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.company-switch-panel-body {
    padding: 16px 18px 18px;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.company-switch-scroll-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: #60a5fa transparent;
}

.company-switch-scroll-area::-webkit-scrollbar,
.company-switch-list::-webkit-scrollbar {
    width: 6px;
}

.company-switch-scroll-area::-webkit-scrollbar-track,
.company-switch-list::-webkit-scrollbar-track {
    background: transparent;
}

.company-switch-scroll-area::-webkit-scrollbar-thumb,
.company-switch-list::-webkit-scrollbar-thumb {
    background: #60a5fa;
    border-radius: 999px;
}

.company-switch-scroll-area::-webkit-scrollbar-thumb:hover,
.company-switch-list::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

.company-switch-divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, #bfdbfe 18%, #93c5fd 50%, #bfdbfe 82%, transparent);
    flex-shrink: 0;
}

.company-switch-grid-label {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    padding: 0 8px 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.company-switch-loading,
.company-switch-empty {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #dbeafe;
    color: #64748b;
}

.company-switch-list {
    display: grid;
    gap: 10px;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: #60a5fa transparent;
}

.company-switch-item {
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    color: inherit;
    border-radius: 14px;
    padding: 14px 14px 14px 16px;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.company-switch-item:hover {
    transform: translateY(-1px);
    border-color: #7dd3fc;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.12);
}

.company-switch-item.current {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12) inset;
}

.company-switch-item:disabled {
    opacity: 0.68;
    cursor: wait;
}

.company-switch-item-title,
.company-switch-item-user {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #0f172a;
}

.company-switch-item-code,
.company-switch-role {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.company-switch-role {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    margin-top: 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    font-size: 11px;
}

.company-switch-role.role-owner {
    background: #dbeafe;
    color: #1d4ed8;
}

.company-switch-role.role-admin {
    background: #cffafe;
    color: #0f766e;
}

.company-switch-role.role-cashier {
    background: #dcfce7;
    color: #15803d;
}

.company-switch-role.role-stock_manager,
.company-switch-role.role-store_keeper {
    background: #fef3c7;
    color: #b45309;
}

.company-switch-role.role-deliveryman {
    background: #ede9fe;
    color: #6d28d9;
}

.company-switch-role.role-member {
    background: #e2e8f0;
    color: #475569;
}

.company-switch-new-company {
    width: 100%;
    margin-top: 14px;
    border: 1px dashed #93c5fd;
    background: #f8fbff;
    color: #0f172a;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.company-switch-new-company:hover {
    transform: translateY(-1px);
    border-color: #60a5fa;
    background: #eff6ff;
}

.company-switch-new-company-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #60a5fa);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    flex-shrink: 0;
}

.company-switch-new-company strong {
    display: block;
    font-size: 15px;
    margin-bottom: 3px;
}

.company-switch-new-company small {
    display: block;
    color: #64748b;
    font-size: 12px;
}

body.company-switch-open {
    overflow: hidden;
}

html[data-theme='dark'] .company-switch-modal {
    background: rgba(2, 6, 23, 0.72);
}

html[data-theme='dark'] .company-switch-panel {
    background: rgba(10, 16, 30, 0.96);
    border-color: rgba(148, 163, 184, 0.18);
    color: #e5eefb;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
}

html[data-theme='dark'] .company-switch-panel-header {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

html[data-theme='dark'] .company-switch-eyebrow {
    color: #7dd3fc;
}

html[data-theme='dark'] .company-switch-subtitle,
html[data-theme='dark'] .company-switch-grid-label,
html[data-theme='dark'] .company-switch-loading,
html[data-theme='dark'] .company-switch-empty,
html[data-theme='dark'] .company-switch-item-code,
html[data-theme='dark'] .company-switch-role,
html[data-theme='dark'] .company-switch-new-company small {
    color: #9fb0c8;
}

html[data-theme='dark'] .company-switch-close {
    background: rgba(15, 23, 42, 0.9);
    color: #e5eefb;
}

html[data-theme='dark'] .company-switch-loading,
html[data-theme='dark'] .company-switch-empty {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.12);
}

html[data-theme='dark'] .company-switch-item {
    border-color: rgba(148, 163, 184, 0.16);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(11, 18, 32, 0.96));
}

html[data-theme='dark'] .company-switch-item-title,
html[data-theme='dark'] .company-switch-item-user,
html[data-theme='dark'] .company-switch-new-company {
    color: #e5eefb;
}

html[data-theme='dark'] .company-switch-item:hover {
    border-color: rgba(125, 211, 252, 0.45);
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.34);
}

html[data-theme='dark'] .company-switch-item.current {
    border-color: rgba(56, 189, 248, 0.62);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.14) inset;
}

html[data-theme='dark'] .company-switch-role.role-owner { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
html[data-theme='dark'] .company-switch-role.role-admin { background: rgba(13, 148, 136, 0.2); color: #5eead4; }
html[data-theme='dark'] .company-switch-role.role-cashier { background: rgba(22, 163, 74, 0.2); color: #86efac; }
html[data-theme='dark'] .company-switch-role.role-stock_manager,
html[data-theme='dark'] .company-switch-role.role-store_keeper { background: rgba(217, 119, 6, 0.2); color: #fcd34d; }
html[data-theme='dark'] .company-switch-role.role-deliveryman { background: rgba(109, 40, 217, 0.22); color: #c4b5fd; }
html[data-theme='dark'] .company-switch-role.role-member { background: rgba(71, 85, 105, 0.34); color: #cbd5e1; }

html[data-theme='dark'] .company-switch-new-company {
    border-color: rgba(125, 211, 252, 0.4);
    background: rgba(8, 17, 32, 0.88);
    color: #e5eefb;
}

html[data-theme='dark'] .company-switch-new-company:hover {
    border-color: rgba(125, 211, 252, 0.7);
    background: rgba(8, 17, 32, 0.98);
}

/* Main container centered in remaining space */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px 0;
    width: calc(100% - 30px);
}

.office-container {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    width: 100%;
    overflow: hidden;
}

/* Header Styles */
.office-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.company-header-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.company-header-text h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.company-switch-trigger {
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
    display: block;
}

.company-switch-trigger:hover .company-header-text h1,
.company-switch-trigger:hover .company-code-header {
    color: #4361ee;
}

.company-header-logo {
    position: relative;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #4361ee !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(67, 97, 238, 0.4);
}

.company-header-initials {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.company-header-logo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.company-code-header {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.company-options-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

.company-options-btn {
    border: 1px solid #dbe1ea;
    background: #ffffff;
    color: #1f2937;
    border-radius: 999px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.company-options-btn:hover,
.company-options-btn[aria-expanded='true'] {
    border-color: #4361ee;
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.16);
}

.company-options-text {
    white-space: nowrap;
}

.company-options-icon {
    width: 16px;
    height: 12px;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.24s ease;
}

.company-options-btn[aria-expanded='true'] .company-options-icon {
    transform: rotate(90deg);
}

.company-options-icon .line {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: #1f2937;
}

.company-options-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    border: 1px solid #dbe1ea;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 1200;
}

.company-options-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.company-options-dropdown.closing {
    opacity: 0;
    visibility: visible;
    transform: translateY(-6px);
}

.company-option-action {
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f8fafc;
    color: #0f172a;
    padding: 10px 11px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    text-align: left;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
}

.company-option-action:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

html[data-theme='dark'] .company-options-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme='dark'] .company-options-btn:hover,
html[data-theme='dark'] .company-options-btn[aria-expanded='true'] {
    border-color: #60a5fa;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

html[data-theme='dark'] .company-options-icon .line {
    background: #cbd5e1;
}

html[data-theme='dark'] .company-options-dropdown {
    background: #111827;
    border-color: #334155;
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.6);
}

html[data-theme='dark'] .company-option-action {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme='dark'] .company-option-action:hover {
    border-color: #60a5fa;
    background: #1e293b;
}

@media (max-width: 520px) {
    .company-options-btn {
        padding: 7px 10px;
        font-size: 0.82rem;
        gap: 7px;
    }

    .company-options-dropdown {
        min-width: 190px;
    }
}

@media (max-width: 740px) {
    .company-switch-panel-header,
    .company-switch-panel-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .company-switch-grid-label,
    .company-switch-item {
        grid-template-columns: 1fr;
    }

    .company-switch-grid-label {
        display: none;
    }

    .company-switch-panel-header h2 {
        font-size: 26px;
    }
}

/* ===== TWO-COLUMN LAYOUT & ROTATING CUBE STYLES ===== */
.company-overview-section {
    display: flex;
    gap: 20px;
    padding: 20px 16px;
    background: linear-gradient(to bottom, #f9fafb, #ffffff);
    border-bottom: 1px solid var(--gray-light);
}

.company-info-container {
    flex: 0 0 55%;
}

.stats-grid-container {
    flex: 0 0 calc(45% - 20px);
    display: flex;
    align-items: stretch;
}

/* Rotating Cube Container - FIXED: No fixed height */
.cube-container {
    perspective: 1500px;
    width: 100%;
    position: relative;
}

.company-cube {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.company-cube.rotate-to-gallery {
    transform: rotateY(180deg);
}

.cube-face {
    width: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    padding: 18px;
    overflow: hidden;
}

.cube-front {
    transform: rotateY(0deg);
    position: relative;
}

.cube-back {
    transform: rotateY(180deg);
    position: absolute;
    top: 0;
    left: 0;
}

/* Company Card Content (Front Face) */
.company-card-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.user-profile-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    align-items: center;
    width: 100%;
}

/* FIXED: Larger avatar with better visibility - Specific to myOffice profile block */
.user-profile-block .user-avatar {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #4361ee;
    border: 4px solid white;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.user-profile-block .user-avatar-initials {
    text-transform: uppercase;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1.5px;
    z-index: 1;
}

.user-meta-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.user-meta-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.user-meta-role {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4361ee;
    background: rgba(67, 97, 238, 0.12);
    border: 1px solid rgba(67, 97, 238, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

.btn-edit-profile,
.btn-edit-company {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-edit-profile {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 3px 10px rgba(67, 97, 238, 0.3);
}

.btn-edit-company {
    background: white;
    color: var(--dark);
    border: 2px solid var(--gray-light);
}

.btn-edit-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(67, 97, 238, 0.4);
}

.btn-edit-company:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    color: var(--primary);
}

/* View Gallery Button */
.btn-view-gallery {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.btn-view-gallery:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.4);
}

.btn-company-poster {
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #0f4bb8, #2f80ed);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
    box-shadow: 0 3px 10px rgba(15, 75, 184, 0.3);
}

.btn-company-poster:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(15, 75, 184, 0.4);
}

/* Stats Side Card */
.stats-side-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    padding: 16px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Stats Grid (2x2) - UNCHANGED */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-light);
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card.active {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.2);
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 2px 0;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
    font-weight: 500;
}

/* ENHANCED: Company Summary with Icons */
.company-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
}

.company-summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--dark);
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    border-radius: 10px;
    transition: var(--transition);
}

.company-summary-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
}

.company-summary-item.office-view-item {
    cursor: pointer;
}

.company-summary-item.office-view-item.active {
    border-color: var(--primary);
    box-shadow: 0 6px 14px rgba(67, 97, 238, 0.16);
    background: #eef3ff;
}

.company-summary-item.office-view-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

html[data-theme='dark'] .company-summary-item.office-view-item.active {
    background: rgba(59, 130, 246, 0.18);
    border-color: #60a5fa;
}

.summary-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.summary-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    color: var(--gray);
    font-weight: 600;
    font-size: 0.8rem;
}

.summary-value {
    font-weight: 700;
    color: var(--dark);
    font-size: 0.85rem;
}

/* ENHANCED: Bio with Icon */
.company-summary-bio {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--gray);
    line-height: 1.5;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-top: 2px;
}

.bio-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(67, 97, 238, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.bio-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.bio-modal-overlay[hidden],
.bio-see-all[hidden] {
    display: none !important;
}

.bio-preview {
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.bio-see-all {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.bio-see-all:hover {
    text-decoration: underline;
}

body.bio-modal-open {
    overflow: hidden;
}

.bio-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 18px;
}

.bio-modal {
    width: min(560px, 100%);
    max-height: 85vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
}

.bio-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.bio-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--dark);
}

.bio-modal-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.bio-modal-body {
    padding: 16px;
    color: #334155;
    line-height: 1.6;
    white-space: normal;
    word-break: break-word;
}

.bio-modal-footer {
    padding: 0 16px 16px;
    display: flex;
    justify-content: flex-end;
}

.bio-modal-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Gallery Container (Back Face) */
.gallery-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    min-height: 350px;
}

/* Gallery Shimmer Loading */
.gallery-shimmer {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    height: 280px;
}

.shimmer-box {
    background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 50%, #e9ecef 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Gallery Content */
.gallery-content {
    flex: 1;
    overflow: hidden;
}

.gallery-grid {
    display: grid;
    gap: 10px;
    height: 280px;
    animation: fadeIn 0.5s ease;
}

.gallery-grid.layout-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.gallery-grid.layout-1 .gallery-item img {
    animation: kenBurns 8s ease-in-out infinite alternate;
    transform-origin: center center;
}

@keyframes kenBurns {
    0%   { transform: scale(1)    translate(0, 0); }
    25%  { transform: scale(1.08) translate(-2%, -1%); }
    50%  { transform: scale(1.12) translate(2%, 1%); }
    75%  { transform: scale(1.08) translate(-1%, 2%); }
    100% { transform: scale(1)    translate(0, 0); }
}

/* Override the hover scale so Ken Burns isn't interrupted */
.gallery-grid.layout-1 .gallery-item:hover img {
    transform: none;
}

.gallery-grid.layout-2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
}

.gallery-grid.layout-3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
}

.gallery-grid.layout-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.gallery-grid.layout-5 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.gallery-grid.layout-5 .gallery-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
}

.gallery-grid.layout-5 .gallery-item:last-child {
    grid-column: 3 / 5;
    grid-row: 2 / 3;
}

.gallery-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    animation: slideIn 0.6s ease forwards;
    opacity: 0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty Gallery State */
.gallery-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: var(--gray);
}

.empty-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.empty-icons i {
    font-size: 42px;
    color: #d0d0d0;
}

.gallery-empty p {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Back to Info Button */
.btn-back-to-info {
    padding: 10px 16px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
}

.btn-back-to-info:hover {
    background: var(--primary);
    color: white;
}

/* Content Section */
.content-section {
    margin-bottom: 0;
    padding: 16px;
    min-height: 400px;
}

/* Products grid - 4x4 on desktop, 2x2 on mobile */
.products-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 0;
}

.posts-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.posts-view .content-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: none;
}

.posts-view .content-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.posts-view .item-image-container {
    height: 120px;
    background: white;
    padding: 12px;
}

.posts-view .item-image {
    object-fit: cover;
}

.posts-view .item-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.products-view .content-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: none;
}

.products-view .content-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.products-view .item-image-container {
    height: 120px;
    background: white;
    padding: 12px;
}

.products-view .item-image {
    object-fit: contain;
}

.products-view .item-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.content-item {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.item-image-container {
    height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-lighter);
    position: relative;
    overflow: hidden;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.content-item:hover .item-image {
    transform: scale(1.05);
}

.item-icon {
    font-size: 48px;
    color: var(--gray);
}

.item-name {
    padding: 15px;
    text-align: center;
    font-weight: 500;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name-text {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-content {
    min-height: 180px;
}

/* Post specific styles */
.post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.content-item:hover .post-overlay {
    opacity: 1;
}

.post-overlay span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 10px;
}

.post-overlay i {
    font-size: 20px;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 30px;
    gap: 10px;
}

.loading-indicator .spinner {
    border: 3px solid rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .company-overview-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .company-info-container,
    .stats-grid-container {
        flex: 1 0 100%;
    }
    
    .stats-grid-container {
        width: 100%;
    }
    
    .stats-side-card {
        height: auto;
    }
}

@media (max-width: 992px) {
    body {
        margin-left: 0;
        padding-top: 60px;
    }
    
    .main-container {
        padding: 20px 0 0;
    }
    
    .office-container {
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .company-overview-section {
        padding: 20px 15px;
    }
    
    .cube-face {
        padding: 20px;
    }
    
    .stats-grid {
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .stat-info h3 {
        font-size: 1.6rem;
    }
    
    .user-profile-block .user-avatar {
        width: 110px;
        height: 110px;
        font-size: 38px;
    }
    
    .user-meta-name {
        font-size: 1.1rem;
    }
    
    .products-view {
        grid-template-columns: repeat(2, 1fr);
    }

    .posts-view {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .company-header-logo {
        width: 60px;
        height: 60px;
    }
    
    .company-header-initials {
        font-size: 22px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .products-view {
        grid-template-columns: repeat(3, 1fr);
    }

    .posts-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
        gap: 8px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 1.4rem;
    }
    
    .stat-info p {
        font-size: 0.8rem;
    }
    
    .user-meta-row {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .gallery-grid.layout-3,
    .gallery-grid.layout-4,
    .gallery-grid.layout-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid.layout-4 {
        grid-template-rows: repeat(2, 1fr);
    }
    
    .gallery-grid.layout-5 .gallery-item:first-child,
    .gallery-grid.layout-5 .gallery-item:last-child {
        grid-column: auto;
        grid-row: auto;
    }
    
    .products-view {
        grid-template-columns: repeat(2, 1fr);
    }

    .posts-view {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-view .item-image-container {
        height: 120px;
    }

    .posts-view .item-image-container {
        height: 120px;
    }
    
    .user-profile-block .user-avatar {
        width: 90px;
        height: 90px;
        font-size: 32px;
    }

    .company-header-logo {
        width: 50px;
        height: 50px;
    }
    
    .company-header-initials {
        font-size: 18px;
    }
}

html[data-theme='dark'] .content-section,
html[data-theme='dark'] .products-view .content-item,
html[data-theme='dark'] .posts-view .content-item,
html[data-theme='dark'] .content-item {
    background: #111827 !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

html[data-theme='dark'] .products-view .content-item:hover,
html[data-theme='dark'] .posts-view .content-item:hover,
html[data-theme='dark'] .content-item:hover {
    border-color: #60a5fa !important;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.48);
}

html[data-theme='dark'] .products-view .item-image-container,
html[data-theme='dark'] .posts-view .item-image-container,
html[data-theme='dark'] .item-image-container {
    background: #0f172a !important;
}

html[data-theme='dark'] .item-name,
html[data-theme='dark'] .item-name-text,
html[data-theme='dark'] .loading-indicator span,
html[data-theme='dark'] .gallery-empty p {
    color: #e2e8f0;
}

html[data-theme='dark'] .empty-icons i,
html[data-theme='dark'] .item-icon {
    color: #64748b;
}

html[data-theme='dark'] .loading-indicator .spinner {
    border-color: rgba(148, 163, 184, 0.3);
    border-top-color: #60a5fa;
}

html[data-theme='dark'] .gallery-item {
    background: #0f172a;
}

html[data-theme='dark'] .btn-back-to-info {
    background: #0f172a;
    color: #93c5fd;
    border-color: #3b82f6;
}

html[data-theme='dark'] .btn-back-to-info:hover {
    background: #1e40af;
    color: #ffffff;
}

html[data-theme='dark'] .stats-grid .stat-card.active {
    border-color: #60a5fa !important;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.55), 0 0 0 2px rgba(96, 165, 250, 0.28), 0 10px 24px rgba(2, 6, 23, 0.45) !important;
}

.user-profile-block .user-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: none;
    z-index: 2;
}