:root {
    --bg-base: #0a0a0b;
    --bg-surface: #141416;
    --bg-elevated: #1c1c1f;
    --bg-hover: #1f1f23;
    --bg-active: #252529;

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(99, 102, 241, 0.5);

    --text-primary: #ededef;
    --text-secondary: #8b8b8e;
    --text-tertiary: #5c5c5f;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-muted: rgba(99, 102, 241, 0.15);
    --accent-glow: 0 0 0 3px rgba(99, 102, 241, 0.18);

    --success: #22c55e;
    --success-muted: rgba(34, 197, 94, 0.15);
    --danger: #ef4444;
    --danger-muted: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.15);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;

    --transition: 0.15s ease;

    --sidebar-w: 240px;
}

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

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.lucide, [data-lucide] {
    color: var(--text-secondary);
    flex-shrink: 0;
}

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

.sidebar-container {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-container::-webkit-scrollbar { width: 0; }

.logo-container {
    padding: 24px 20px 20px;
}

.company-logo {
    width: 100px;
    display: block;
    opacity: 0.9;
    transition: opacity var(--transition);
    cursor: pointer;
}

.company-logo:hover { opacity: 0.7; }

.sidebar {
    padding: 0 8px 24px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    transition: background var(--transition), color var(--transition);
    user-select: none;
}

.menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.menu-item .lucide {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
    color: inherit;
}

.menu-item.active {
    background: var(--accent-muted);
    color: var(--accent);
}

.menu-item.active .lucide { color: var(--accent); }

.content {
    flex: 1;
    padding: 32px;
    min-width: 0;
    overflow-x: hidden;
}

.content-inner {
    max-width: 1200px;
}

.page-header {
    margin-bottom: 24px;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1.35;
}

h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
    font-family: var(--font);
    transition: background var(--transition);
    white-space: nowrap;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { opacity: 0.9; }
.btn-primary .lucide { width: 15px; height: 15px; color: #fff; stroke-width: 2; }

.manage-btn, .add-btn { margin: auto; }

.search-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.search-container input[type="search"] {
    width: 220px;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-container input[type="search"]:focus {
    border-color: var(--border-focus);
    box-shadow: var(--accent-glow);
    outline: none;
}

.search-container input[type="search"]::placeholder { color: var(--text-tertiary); }

.search-container .lucide {
    position: absolute;
    right: 10px;
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-box { display: flex; align-items: center; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.status-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-filter select,
.header input[type="search"] {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.status-filter select option { background: var(--bg-elevated); color: var(--text-primary); }

.status-filter select:focus,
.header input[type="search"]:focus {
    border-color: var(--border-focus);
    box-shadow: var(--accent-glow);
    outline: none;
}

.employee-container {
    background: transparent;
    padding: 0;
}

.employee-headers {
    display: flex;
    align-items: center;
    padding: 0 16px 8px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-name-position { width: 40%; }
.header-phone { width: 30%; margin-left: 16px; }
.header-salary { width: 30%; margin-left: 16px; }
.header-settings { width: 20px; }
.header-settings .lucide { width: 16px; height: 16px; color: var(--text-tertiary); }

.employee {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    margin-bottom: 4px;
    color: var(--text-primary);
    position: relative;
    transition: background var(--transition), border-color var(--transition);
}

.employee:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.avatar-name-position {
    display: flex;
    align-items: center;
    width: 30%;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.name-position { display: flex; flex-direction: column; }
.name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.position { font-size: 12px; color: var(--text-secondary); }

.salary, .phone {
    margin-left: 16px;
    width: 20%;
    font-size: 14px;
    color: var(--text-primary);
}

.employees-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.delete-edit {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    align-items: center;
}

.delete-edit .lucide {
    width: 15px;
    height: 15px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color var(--transition);
    stroke-width: 1.75;
    padding: 2px;
}

.delete-edit .lucide:hover { color: var(--text-primary); }
.delete-edit .lucide.icon-delete:hover { color: var(--danger); }

.delete-edit-mod {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 20px 0;
}

.pagination span {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    margin-right: 6px;
}

.pagination a {
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: background var(--transition), border-color var(--transition);
}

.pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.pagination-link.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-primary);
    cursor: pointer;
    margin-left: 6px;
    appearance: none;
}

.pagination select option { background: var(--bg-elevated); color: var(--text-primary); }
.pagination select:focus { outline: none; border-color: var(--border-focus); }

.sort-icon-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 3px;
}

.sort-icon-wrap .lucide {
    width: 13px;
    height: 13px;
    color: var(--text-tertiary);
    stroke-width: 2;
}

.sort-icon-wrap:hover .lucide { color: var(--accent); }

.sort-icon {
    width: 13px;
    margin-right: 3px;
    color: var(--text-tertiary);
    cursor: pointer;
}

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 11, 0.7);
    z-index: 9999;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.text-center { text-align: center; }
.burger-icon { display: none; }

#assigned_employees { list-style: none; padding: 0; }
#assigned_employees li { padding: 3px 0; }
#assigned_employees label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success { background: var(--success-muted); color: var(--success); }
.badge-danger { background: var(--danger-muted); color: var(--danger); }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-accent { background: var(--accent-muted); color: var(--accent); }

.revenue { font-weight: 600; color: var(--success); }
.expense { font-weight: 600; color: var(--danger); }
.wait_revenue { font-weight: 600; color: var(--success); opacity: 0.6; }
.wait_expense { font-weight: 600; color: var(--danger); opacity: 0.6; }
.bold { font-weight: 600; color: var(--text-primary); }

.copy_url {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: color var(--transition);
}
.copy_url:hover { color: var(--accent-hover); }

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.25s ease, toastOut 0.3s ease 3.7s forwards;
    max-width: 360px;
    word-break: break-word;
}

.toast-success { border-color: var(--success); color: var(--success); }
.toast-error { border-color: var(--danger); color: var(--danger); }
.toast-info { border-color: var(--accent); color: var(--accent); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-10px); }
}

@media only screen and (max-width: 768px) {
    .sidebar-container {
        width: 100%;
        min-width: unset;
        position: sticky;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .logo-container { width: 100%; min-width: unset; }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 6px 6px;
        gap: 0;
    }

    .menu-item {
        flex: 1;
        justify-content: center;
        padding: 8px;
        min-width: 40px;
    }

    .menu-item .lucide { width: 20px; height: 20px; }
    .menu-item span { display: none; }

    .container { display: block; }
    .content { width: 100%; padding: 16px; }
    .content-inner { padding: 0; }

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

    h1 { font-size: 20px; }
    .mobile-hide { display: none !important; }
    .employee { font-size: 13px; }
    .avatar-name-position { width: 60%; }

    .logo-container {
        padding: 10px 0;
        position: relative;
    }

    .company-logo { margin: auto; }

    .burger-icon {
        position: absolute;
        top: 50%;
        left: 16px;
        transform: translateY(-50%);
        width: 22px;
        height: 22px;
        display: block;
    }

    .search-container input[type="search"],
    .search-container { width: 100%; }

    .filters, .status-filter { width: 100%; }
    .status-filter select { flex: 1; width: 100%; }

    .employees-title { margin-bottom: 6px; text-align: center; }

    .btn-primary { width: 100%; justify-content: center; }

    .delete-edit { right: 8px; }
    .delete-edit .lucide { width: 14px; height: 14px; }
    .header-name-position { width: 100%; }
}

@media only screen and (max-width: 600px) {
    .sidebar-container { box-shadow: 0 1px 0 var(--border); }
}
