/* open-sans-300 - latin_cyrillic */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/open-sans/open-sans-v44-latin_cyrillic-300.woff2') format('woff2');
}
/* open-sans-regular - latin_cyrillic */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/open-sans/open-sans-v44-latin_cyrillic-regular.woff2') format('woff2');
}
/* open-sans-600 - latin_cyrillic */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/open-sans/open-sans-v44-latin_cyrillic-600.woff2') format('woff2');
}
/* open-sans-700 - latin_cyrillic */
@font-face {
  font-display: swap;
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/open-sans/open-sans-v44-latin_cyrillic-700.woff2') format('woff2');
}


:root {
    /* Layout */
    --aside-width: 200px;
    --aside-collapsed-width: 50px;
    --current-aside-width: var(--aside-width);

    /* Base backgrounds */
    --bg-base: #0f172a;
    --bg-base-flat: #0f172a;
    --bg-base-rgb: 15, 23, 42;
    --bg-base-flat-rgb: 15, 23, 42;
    --bg-muted: var(--surface-05);
    --overlay-rgb: 15, 23, 42;

    /* Glass / special surfaces */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-bg-shaded: rgba(94, 71, 200, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --select-option-bg: #1a2234;

    /* Text */
    --text-main: #f8fafc;
    --text-main-rgb: 248, 250, 252;
    --text-muted: #94a3b8;
    --text-muted-rgb: 148, 163, 184;
    --text-on-accent: #ffffff;
    --text-subtle: rgba(255, 255, 255, 0.7);
    --text-soft: rgba(255, 255, 255, 0.8);
    --text-strong-soft: rgba(255, 255, 255, 0.82);
    --text-body-soft: rgba(255, 255, 255, 0.9);

    /* Core brand / accent */
    --accent: #6366f1;
    --accent-rgb: 99, 102, 241;
    --accent-soft: #a78bfa;
    --primary-color: #60a5fa;
    --primary-color-rgb: 59, 130, 246;
    --primary-glow: #5d47c8;
    --primary-glow-rgb: 93, 71, 200;

    /* Semantic colors */
    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --success-strong: #34d399;
    --success-bright: #4ade80;
    --success-bright-rgb: 74, 222, 128;
    --success-soft: #86efac;
    --success-soft-rgb: 134, 239, 172;

    --warning: #f59e0b;
    --warning-rgb: 245, 158, 11;
    --warning-strong: #fbbf24;
    --warning-soft: #fde68a;

    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    --danger-strong: #f87171;
    --danger-soft: #ff8e8e;
    --danger-soft-rgb: 255, 142, 142;

    --info-soft: #93c5fd;

    /* Neutral */
    --neutral-strong: #475569;
    --neutral-medium: #4b5563;
    --neutral-medium-rgb: 75, 85, 99;

    /* Surfaces */
    --surface-01: rgba(255, 255, 255, 0.01);
    --surface-02: rgba(255, 255, 255, 0.02);
    --surface-03: rgba(255, 255, 255, 0.03);
    --surface-04: rgba(255, 255, 255, 0.04);
    --surface-05: rgba(255, 255, 255, 0.05);
    --surface-06: rgba(255, 255, 255, 0.06);
    --surface-08: rgba(255, 255, 255, 0.08);
    --surface-10: rgba(255, 255, 255, 0.1);
    --surface-12: rgba(255, 255, 255, 0.12);
    --surface-15: rgba(255, 255, 255, 0.15);
    --surface-18: rgba(255, 255, 255, 0.18);
    --surface-22: rgba(255, 255, 255, 0.22);

    /* Borders */
    --border-03: rgba(255, 255, 255, 0.03);
    --border-05: rgba(255, 255, 255, 0.05);
    --border-06: rgba(255, 255, 255, 0.06);
    --border-08: rgba(255, 255, 255, 0.08);
    --border-10: rgba(255, 255, 255, 0.1);
    --border-12: rgba(255, 255, 255, 0.12);
    --border-15: rgba(255, 255, 255, 0.15);
    --border-20: rgba(255, 255, 255, 0.2);
    --border-22: rgba(255, 255, 255, 0.22);
    --border-28: rgba(255, 255, 255, 0.28);

    /* Overlays */
    --overlay-10: rgba(0, 0, 0, 0.1);
    --overlay-20: rgba(0, 0, 0, 0.2);
    --overlay-40: rgba(0, 0, 0, 0.4);
    --overlay-50: rgba(0, 0, 0, 0.5);
    --overlay-58: rgba(15, 23, 42, 0.58);
    --overlay-60: rgba(0, 0, 0, 0.6);
    --overlay-70: rgba(0, 0, 0, 0.7);
    --overlay-80: rgba(0, 0, 0, 0.8);

    /* Shadows */
    --shadow-card: 1px 2px 9px 0 rgba(0, 0, 0, 0.2);
    --shadow-soft: 0 8px 25px rgba(0, 0, 0, 0.28);
    --shadow-primary: 0 4px 15px rgba(59, 130, 246, 0.4);
    --shadow-primary-strong: 0 8px 25px rgba(59, 130, 246, 0.5);
    --shadow-primary-soft: 0 4px 12px rgba(59, 130, 246, 0.4);
    --shadow-primary-glow: 0 0 20px rgba(59, 130, 246, 0.5);
    --shadow-accent-glow: 0 0 5px rgba(99, 102, 241, 0.3);
    --shadow-accent-soft: 0 8px 18px rgba(79, 70, 229, 0.18);
    --shadow-success-glow: 0 0 5px rgba(16, 185, 129, 0.3);
    --shadow-modal: 0 25px 70px rgba(0, 0, 0, 0.45);
    --shadow-modal-lg: 0 15px 50px rgba(0, 0, 0, 0.5);
    --shadow-sidebar: 12px 0 34px rgba(15, 23, 42, 0.05);
    --shadow-sidebar-mobile: 18px 0 36px rgba(15, 23, 42, 0.3);

    /* Domain-specific */
    --processing-phase-ready-rgb: 110, 188, 125;
    --processing-phase-active-rgb: 95, 184, 176;
    --processing-phase-muted-rgb: 92, 112, 136;

    /* Brand colors */
    --brand-email: #55acee;
    --brand-phone: #34af23;
    --brand-whatsapp: #25d366;
    --brand-viber: #7360f2;
    --brand-wechat: #09b83e;
    --brand-line: #00c300;
    --brand-facebook: #1877f2;
    --brand-vk: #4c75a3;
    --brand-web: #4285f4;
    --brand-instagram: #e4405f;
    --brand-skype: #00aff0;
    --brand-telegram: #0088cc;
    --brand-kakao: #ffcd00;
    --brand-paypal: #003087;
    --brand-linkedin: #0077b5;
    --brand-youtube: #ff0000;
    --brand-twitter: #1da1f2;
    --brand-google: #db4a39;
    --brand-tiktok: #111827;

    /* Dashboard Metrics */
    --chart-requests: #38bdf8;
    --chart-bookings: #ef4444;
    --chart-dialogs: #8b5cf6;
    --chart-conversion: #10b981;
}
:root[data-theme="light"] {
    /* Base backgrounds */
    --bg-base: #eef3fb;
    --bg-base-flat: #f8fafc;
    --bg-base-rgb: 238, 243, 251;
    --bg-base-flat-rgb: 248, 250, 252;

    /* Glass / special surfaces */
    --glass-bg: rgba(255, 255, 255, 0.78);
    --glass-bg-shaded: rgba(79, 70, 229, 0.08);
    --glass-border: rgba(15, 23, 42, 0.09);
    --select-option-bg: #f8fafc;

    /* Text */
    --text-main: #0f172a;
    --text-main-rgb: 15, 23, 42;
    --text-muted: #64748b;
    --text-muted-rgb: 100, 116, 139;
    --text-subtle: rgba(15, 23, 42, 0.7);
    --text-soft: rgba(15, 23, 42, 0.8);
    --text-strong-soft: rgba(15, 23, 42, 0.82);
    --text-body-soft: rgba(15, 23, 42, 0.9);

    /* Accent */
    --accent: #4f46e5;
    --accent-rgb: 79, 70, 229;
    --primary-glow: #4f46e5;
    --primary-glow-rgb: 79, 70, 229;

    /* Surfaces */
    --surface-01: rgba(15, 23, 42, 0.01);
    --surface-02: rgba(15, 23, 42, 0.02);
    --surface-03: rgba(15, 23, 42, 0.03);
    --surface-04: rgba(15, 23, 42, 0.04);
    --surface-05: rgba(15, 23, 42, 0.05);
    --surface-06: rgba(15, 23, 42, 0.06);
    --surface-08: rgba(15, 23, 42, 0.08);
    --surface-10: rgba(15, 23, 42, 0.1);
    --surface-12: rgba(15, 23, 42, 0.12);
    --surface-15: rgba(15, 23, 42, 0.15);
    --surface-18: rgba(15, 23, 42, 0.18);
    --surface-22: rgba(15, 23, 42, 0.22);

    /* Borders */
    --border-03: rgba(15, 23, 42, 0.03);
    --border-05: rgba(15, 23, 42, 0.05);
    --border-06: rgba(15, 23, 42, 0.06);
    --border-08: rgba(15, 23, 42, 0.08);
    --border-10: rgba(15, 23, 42, 0.1);
    --border-12: rgba(15, 23, 42, 0.12);
    --border-15: rgba(15, 23, 42, 0.15);
    --border-20: rgba(15, 23, 42, 0.2);
    --border-22: rgba(15, 23, 42, 0.22);
    --border-28: rgba(15, 23, 42, 0.28);

    --select-option-bg: #f8fafc;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--surface-05);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-22);
    border-radius: 10px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Firefox support */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-22) var(--surface-05);
}

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

ul, ol {
    padding-left: 2rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}
li {
    margin-bottom: 0.5rem;
}

body, input, select, textarea, button {
    font-family: 'Open Sans', 'Tahoma', 'Verdana', sans-serif;
}

body {
    font-weight: 300;
    line-height: 1.6;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(var(--primary-color-rgb), 0.15) 0, transparent 50%),
        radial-gradient(at 100% 100%, rgba(var(--accent-rgb), 0.15) 0, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--aside-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 10px 0 10px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    transition: width 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: var(--overlay-58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 95;
}

.main-content {
    flex: 1;
    margin-left: var(--aside-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

header {
    height: 60px;
    background: rgba(var(--overlay-rgb), 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 15px;
    flex-wrap: wrap;
}

.content-body {
    padding: 15px;
    min-width: 0;
}

/* Typography & Effects */
.logo {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text-main);
}
.logo img {
    width: 35px;
    height: 35px;
    margin: 0 8px;
}
.logo span {
    display: inline-block;
    white-space: nowrap;
    transition: opacity 0.2s ease, max-width 0.2s ease;
}
.logo-icon {
    width: 35px;
    height: 35px;
    background: var(--primary-glow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-primary-glow);
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.nav-links li {
    margin-bottom: 0;
}
.nav-links li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 7px 12px 7px 15px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-bottom: 0px;
}

.nav-link-tag {
    margin-left: auto;
    padding: 3px 8px;
    font-size: 10px;
    line-height: 1.2;
}

.nav-link-label {
    display: inline-block;
    min-width: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease, max-width 0.2s ease;
}

.nav-links li a > i {
    width: 1.25em;
    min-width: 1.25em;
    text-align: center;
    flex-shrink: 0;
}
.nav-links li a:hover, .nav-links li.active a {
    background: var(--surface-05);
    color: var(--text-main);
}
.nav-links li.active a {
    background: var(--primary-glow);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
}

/* Glass Cards & Panels */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--shadow-card);
    margin-bottom: 15px;
}

.c360-filter-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgb(var(--bg-base-flat-rgb));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-bottom: 25px;
}

/* Tables */
.c360-table {
    width: 100%;
    border-collapse: collapse;
    /*border-spacing: 0 5px;*/
}
.c360-table th {
    text-align: left;
    padding: 10px 15px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.c360-table td {
    background: var(--surface-01);
    padding: 6px 12px;
    font-size: 14px;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}
h1 i, h2 i, h3 i, h4 i, h5 i {
    margin-right: 5px;
}

.mt-10 {margin-top: 10px!important;}
.mt-20 {margin-top: 20px!important;}
.mt-30 {margin-top: 30px!important;}


/* Dictionary Pills */
.lookup-tabs {
    display: flex;
    background: var(--overlay-20);
    padding: 5px;
    border-radius: 12px;
    gap: 5px;
    flex-wrap: wrap;
}
.lookup-tabs a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.lookup-tabs a.active {
    background: var(--primary-glow);
    color: var(--text-on-accent);
    box-shadow: 0 4px 10px rgba(var(--primary-color-rgb), 0.3);
}
.c360-table tr td:first-child {
    border-left: 1px solid var(--glass-border);
    /*border-radius: 16px 0 0 16px;*/
}
.c360-table tr td:last-child {
    border-right: 1px solid var(--glass-border);
    /*border-radius: 0 16px 16px 0;*/
}
.c360-table tr:hover td {
    background: var(--surface-06);
    cursor: pointer;
}

/* Badges */
.badge {
    padding: 3px 9px;
    border-radius: 8px;
    font-size: .6em;
    font-weight: 600;
    display: inline-block;
}
.badge-blue { background: rgba(var(--primary-color-rgb), 0.2); color: var(--primary-color); border: 1px solid rgba(var(--primary-color-rgb), 0.3); }
.badge-green { background: rgba(var(--success-rgb), 0.2); color: var(--success-strong); border: 1px solid rgba(var(--success-rgb), 0.3); }
.badge-yellow { background: rgba(var(--warning-rgb), 0.2); color: var(--warning-strong); border: 1px solid rgba(var(--warning-rgb), 0.3); }

/* Inputs */
.search-bar {
    background: var(--surface-05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    width: 350px;
    position: relative;
    overflow: hidden;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 0 0 15px;
    box-sizing: border-box;
    min-width: 0;
    transition: padding 0.2s ease;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    height: 25px;
    min-width: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.global-search-submit {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 34px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.global-search-submit:hover {
    background: var(--surface-10);
    color: var(--primary-color);
}

.header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 320px;
}

.global-search-bar {
    flex: 1 1 320px;
    max-width: 420px;
    min-width: 0;
    transition: flex-basis 0.2s ease, width 0.2s ease, min-width 0.2s ease, max-width 0.2s ease;
}

.sidebar-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--surface-05);
    color: var(--text-main);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--surface-10);
}

@media (min-width: 901px) {
    body.is-sidebar-collapsed .sidebar {
        width: var(--aside-collapsed-width);
        overflow-x: hidden;
    }

    body.is-sidebar-collapsed .main-content {
        margin-left: var(--aside-collapsed-width);
    }
    body.is-sidebar-collapsed {
        --current-aside-width: var(--aside-collapsed-width);
    }
}

/* Moved into .search-bar styles above */

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}

.project-switcher {
    min-width: 0;
    transition: flex-basis 0.2s ease, width 0.2s ease, min-width 0.2s ease, max-width 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.project-switcher select {
    background: var(--surface-05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    padding: 2px 10px;
    outline: none;
}

.notifications,
.user-profile {
    display: flex;
    align-items: center;
    justify-content: center;
}
#bell-icon {
    font-size: 1.4rem;
    display: flex;
    text-decoration: none;
}
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.user-menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

.user-menu-icon {
    color: var(--text-muted);
}

.user-menu-name {
    font-size: 13px;
    color: var(--text-main);
}


.user-menu-caret {
    font-size: 11px;
    color: var(--text-muted);
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: 42px;
    min-width: 180px;
    z-index: 110;
    padding: 8px;
}

.user-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-menu-link:hover {
    background: var(--surface-08);
}

.user-menu-form {
    margin: 0;
}

.user-menu-link--button {
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

/* Stats */
.dashboard-stats,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--glass-bg);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin-bottom: 0;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.stat-value { font-size: 32px; font-weight: 700; margin-top: 10px; }

/* Buttons */
.btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid transparent; /* Ensure consistent height for buttons without/with borders */
    cursor: pointer;
    font-family: inherit;
    font-size: .8em;
    font-weight: 600;
    line-height: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    color: inherit;
}
.btn-primary { background: var(--primary-glow); color: var(--text-on-accent); box-shadow: var(--shadow-primary); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary-strong); }
.btn-icon { color: var(--text-muted); padding: 8px; border-radius: 8px; text-decoration: none; }
.btn-icon:hover { background: var(--surface-10); color: var(--text-main); }
a.btn {
    text-decoration: none;
}

#search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 8px;
    display: none;
    border-radius: 12px;
    background: var(--bg-base);
    max-height: 320px;
    overflow-y: auto;
}
.search-item {
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    display: block;
}
.search-item:hover { background: var(--surface-10); }
.search-item + .search-item {
    margin-top: 4px;
}
.search-item-title {
    font-weight: 600;
    font-size: 14px;
}
.search-item-type,
.search-results-message {
    font-size: 11px;
    color: var(--text-muted);
}
.search-item-type {
    margin-top: 2px;
}
.search-wave-badge {
    font-size: 0.75em;
    color: var(--text-muted);
    background: var(--overlay-10);
    padding: 2px 4px;
    border-radius: 4px;
    margin-left: 5px;
}
.search-results-message {
    padding: 10px;
}

/* Pagination */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 10px;
}
.pagination-info {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--surface-05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}
.page-link:hover {
    background: var(--surface-10);
    color: var(--text-main);
    border-color: var(--border-20);
}
.page-link.active {
    background: var(--primary-glow);
    color: var(--text-on-accent);
    border-color: transparent;
    box-shadow: var(--shadow-primary-soft);
}
.page-link.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.page-jump input {
    width: 50px;
    padding: 6px;
    background: var(--surface-05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-main);
    text-align: center;
    font-weight: 600;
}
.page-jump input:focus {
    outline: none;
    border-color: var(--primary-glow);
    background: var(--surface-10);
}

/* Utilities */
.flex-between-center { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-gap-10 { gap: 10px; }
.flex-gap-20 { gap: 20px; }
.flex-gap-30 { gap: 30px; }
.m-b-25 { margin-bottom: 25px; }
.m-b-30 { margin-bottom: 30px; }
.m-t-15 { margin-top: 15px; }
.m-t-40 { margin-top: 40px; }
.w-100 { width: 100%; }
.w-auto { width: auto !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-strong { font-weight: 700 !important; }
.text-warning { color: var(--warning) !important; }
.opacity-5 { opacity: 0.5; }
.p-0 { padding: 0 !important; }
.m-0 { margin: 0 !important; }
.bg-none { background: none !important; }
.border-none { border: none !important; }

/* Fixed Widths */
.w-40 { width: 40px !important; }
.w-80 { width: 80px !important; }
.w-100-px { width: 100px !important; }
.w-140 { width: 140px !important; }
.w-150 { width: 150px !important; }
.w-200 { width: 200px !important; }
.w-350 { width: 350px !important; }

/* Localization Table */
.labels-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.labels-toolbar__title {
    margin: 0;
}
.labels-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}
.labels-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.c360-table--labels {
    table-layout: fixed;
}
.c360-table--labels th:first-child,
.c360-table--labels td:first-child {
    width: 240px;
    word-break: break-all;
    overflow-wrap: break-word;
}
.c360-table--labels code {
    white-space: pre-wrap;
    word-break: break-all;
}
.translation-textarea {
    display: block;
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    padding: 5px;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 40px;
}
.translation-textarea:focus {
    border-color: var(--primary-glow);
    outline: none;
    background: var(--surface-05);
}
.translation-textarea.saving {
    border-color: var(--primary-glow);
}
.translation-textarea.saved {
    background-color: rgba(var(--success-rgb), 0.1);
    border-color: var(--success);
}

@media (max-width: 900px) {
    .labels-toolbar__actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

/* User Profile & Forms */
.profile-card {
    max-width: 920px;
    margin: 0 auto;
    position: relative;
}
.profile-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 30px;
}
.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
}
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-05);
    border: 2px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay-40);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.avatar-preview:hover .avatar-overlay {
    opacity: 1;
}

.profile-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 30px 0 10px;
}

.profile-pref-card {
    margin-bottom: 0;
    height: 100%;
}

.profile-pref-card__head {
    margin-bottom: 14px;
}

.profile-pref-card__head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-size: 17px;
}

.profile-pref-card__head p,
.profile-pref-note {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.profile-pref-note {
    margin-top: 12px;
}

.profile-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-choice-option {
    position: relative;
}

.profile-choice-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-choice-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.profile-choice-option:hover .profile-choice-pill {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.28);
}

.profile-choice-option input:checked + .profile-choice-pill {
    background: rgba(var(--accent-rgb), 0.18);
    border-color: rgba(var(--accent-rgb), 0.42);
    color: var(--text-main);
    box-shadow: var(--shadow-accent-soft);
}

.form-row {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}
.form-label {
    width: 150px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.form-value {
    flex: 1;
}
.form-input, .form-select {
    width: 100%;
    background: var(--surface-05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 7px 10px;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s ease;
}
.form-input:focus, .form-select:focus {
    border-color: var(--primary-glow);
    background: var(--surface-08);
}
.form-select {
    appearance: none;
    cursor: pointer;
}
.form-select option {
    background: var(--bg-base);
    color: var(--text-main);
}
.form-input, .form-select, .translation-textarea, .transparent-input, .transparent-select, .transparent-textarea, .order-title-input {
    transition: border-color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.field-changed, .field-saving {
    border-color: var(--accent) !important;
    background-color: rgba(var(--accent-rgb), 0.08) !important;
    box-shadow: var(--shadow-accent-glow) !important;
}

.field-saving {
    animation: pulse-border-accent 1.5s infinite;
}

.field-success {
    border-color: var(--success) !important;
    background-color: rgba(var(--success-rgb), 0.1) !important;
    box-shadow: var(--shadow-success-glow) !important;
}

.btn-save-error {
    background: var(--text-muted) !important; /* Grey state */
    border-color: var(--neutral-strong) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    /* Prevent icon from being hidden if we changed HTML, but we will handle HTML in JS */
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes pulse-border-accent {
    0% { border-color: var(--accent); }
    50% { border-color: rgba(var(--accent-rgb), 0.4); }
    100% { border-color: var(--accent); }
}

hr {
    background: var(--glass-border);
    height: 1px;
    border: 0;
    margin: 8px 0;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}



:root[data-theme="light"] body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(at 0% 0%, rgba(var(--primary-color-rgb), 0.12) 0, transparent 48%),
        radial-gradient(at 100% 100%, rgba(var(--accent-rgb), 0.12) 0, transparent 52%);
}

:root[data-theme="light"] .sidebar {
    background: rgba(var(--bg-base-flat-rgb), 0.84);
    border-right-color: var(--border-08);
    box-shadow: var(--shadow-sidebar);
}

:root[data-theme="light"] header {
    background: rgba(var(--bg-base-flat-rgb), 0.78);
    border-bottom-color: var(--border-08);
}

:root[data-theme="light"] .glass-card,
:root[data-theme="light"] .stat-card,
:root[data-theme="light"] #search-results,
:root[data-theme="light"] .user-menu-dropdown {
    box-shadow: 0 12px 30px rgba(var(--overlay-rgb), 0.08);
}

:root[data-theme="light"] .logo,
:root[data-theme="light"] .search-bar input,
:root[data-theme="light"] .project-switcher select,
:root[data-theme="light"] .user-menu-name,
:root[data-theme="light"] .user-menu-link,
:root[data-theme="light"] .search-item-title,
:root[data-theme="light"] .form-input,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .translation-textarea {
    color: var(--text-main);
}

:root[data-theme="light"] .nav-links li a {
    color: var(--neutral-strong);
}

:root[data-theme="light"] .nav-links li a:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-main);
}

:root[data-theme="light"] .nav-links li.active a {
    color: var(--bg-base);
}
:root[data-theme="light"] .nav-links li.active:hover a {
    color: var(--text-main);
}

:root[data-theme="light"] .search-bar,
:root[data-theme="light"] .project-switcher select,
:root[data-theme="light"] .page-link,
:root[data-theme="light"] .form-input,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .translation-textarea {
    background: rgba(var(--bg-base-flat-rgb), 0.88);
    border-color: var(--border-10);
}

:root[data-theme="light"] .search-item:hover,
:root[data-theme="light"] .user-menu-link:hover,
:root[data-theme="light"] .page-link:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-main);
}

:root[data-theme="light"] .btn-icon:hover {
    color: var(--text-main);
}

:root[data-theme="light"] .c360-table th {
    color: var(--text-muted);
}

:root[data-theme="light"] .c360-table td {
    background: rgba(var(--bg-base-flat-rgb), 0.72);
}

:root[data-theme="light"] .c360-table tr:hover td {
    background: rgba(var(--accent-rgb), 0.06);
}

:root[data-theme="light"] .form-select option {
    background: var(--text-main);
    color: var(--glass-bg);
}

:root[data-theme="light"] .profile-choice-pill {
    background: rgba(var(--bg-base-flat-rgb), 0.92);
}

@media (max-width: 900px) {
    header {
        height: auto;
        padding: 12px 15px;
        gap: 10px;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .sidebar {
        width: min(280px, calc(100vw - 44px));
        height: 100dvh;
        transform: translateX(-100%);
        box-shadow: var(--shadow-sidebar-mobile);
    }

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

    .header-main {
        width: auto;
        flex: 1 1 auto;
        gap: 10px;
        min-width: 0;
    }

    .header-right {
        width: auto;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
    }

    .project-switcher {
        flex: 0 0 130px;
        width: 130px;
        min-width: 130px;
        max-width: 130px;
        overflow: hidden;
    }

    .project-switcher select {
        width: 100%;
    }

    .project-switcher.is-mobile-hidden {
        flex-basis: 0;
        width: 0;
        min-width: 0;
        max-width: 0;
        opacity: 0;
        pointer-events: none;
        transform: translateX(16px);
    }

    .project-switcher.is-mobile-hidden select {
        visibility: hidden;
    }

    .global-search-bar {
        flex: 1 1 auto;
        width: auto;
        min-width: 100px;
        max-width: 400px;
    }

    .global-search-bar.is-mobile-collapsed {
        flex: 0 0 35px;
        width: 35px;
        min-width: 35px;
        max-width: 35px;
    }

    .global-search-bar.is-mobile-collapsed .search-input-wrapper {
        padding: 0 2px;
    }

    .global-search-bar.is-mobile-collapsed input {
        width: 0;
        opacity: 0;
        pointer-events: none;
    }

    header.is-mobile-search-expanded .global-search-bar {
        max-width: none;
    }

    .user-menu-name {
        display: none;
    }

    body.is-sidebar-open {
        overflow: hidden;
    }

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

    body.is-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 640px) {
    header {
        height: auto;
        padding: 12px;
    }

    .content-body {
        padding: 12px;
    }

    .notif-dropdown,
    .user-menu-dropdown {
        width: min(300px, calc(100vw - 24px));
        right: 0;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-label {
        width: auto;
    }

    .page-jump {
        margin-left: 0;
        justify-content: center;
    }
}

/* Prevent mobile Safari from zooming the page when text inputs receive focus. */
@media (max-width: 768px) {
    :where(
        input:not([type="button"]):not([type="checkbox"]):not([type="color"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="radio"]):not([type="range"]):not([type="reset"]):not([type="submit"]),
        select,
        textarea
    ) {
        font-size: 16px;
    }
}

/* Unified Tabs System (c360-tabs) */
.c360-tabs {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--glass-border);
}

.c360-tab-item {
    padding: 12px 0 5px 0;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.c360-tab-item:hover {
    color: var(--text-main);
}

.c360-tab-item.is-active {
    color: var(--accent);
    border-bottom-color: var(--primary-glow);
}

.c360-tab-pane {
    display: none;
}

.c360-tab-pane.is-active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

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

/* Project Order Settings */
.project-order-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 12px;
}

.project-order-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-order-toggle {
    margin-bottom: 0;
    cursor: pointer;
}

.project-order-field {
    max-width: 300px;
}

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }

@media (max-width: 768px) {
    .project-order-settings-grid {
        grid-template-columns: 1fr;
    }
}
