:root {
    /* Цветовая палитра (Dark Dashboard) */
    --bg-body: #151521;
    /* Очень темный фон (body) */
    --bg-sidebar: #1e1e2d;
    /* Фон сайдбара */
    --bg-card: #1e1e2d;
    /* Фон карточек */
    --bg-hover: #2b2b40;
    /* Фон при наведении */

    --text-primary: #ffffff;
    --text-secondary: #92929f;
    --text-muted: #5e6278;

    --primary-color: #3699ff;
    /* Яркий синий (акцент) */
    --success-color: #1bc5bd;
    /* Бирюзовый/Зеленый */
    --warning-color: #ffa800;
    /* Оранжевый */
    --danger-color: #f64e60;
    /* Красный */

    --border-radius: 12px;
    --shadow-soft: 0 0 20px 0 rgba(76, 87, 125, 0.02);

    --sidebar-width: 250px;
    --header-height: 70px;
}

[data-theme="light"] {
    --bg-body: #f4f6f8;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f1f1f1;

    --text-primary: #181c32;
    --text-secondary: #5e6278;
    --text-muted: #b5b5c3;

    --primary-color: #009ef7;
    --shadow-soft: 0 0 20px 0 rgba(76, 87, 125, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

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

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand span {
    color: var(--warning-color);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-item {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--bg-hover);
    color: var(--primary-color);
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

/* --- Cards --- */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-soft);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* --- Forms & Inputs --- */
input,
select,
textarea {
    background-color: var(--bg-body);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    /* Default to full width in containers */
    margin-bottom: 10px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

button.primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

button.primary:hover {
    filter: brightness(1.1);
}

button.danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

tr:hover td {
    color: var(--text-primary);
}

/* --- Utility --- */
.text-muted {
    color: var(--text-muted);
}

.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.space-between {
    justify-content: space-between;
}

.mb-20 {
    margin-bottom: 20px;
}

/* --- Tabs (migrated from operator style) --- */
.tabs-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-link {
    padding: 10px 0;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-new {
    background: rgba(54, 153, 255, 0.1);
    color: #3699ff;
}

.badge-kitted {
    background: rgba(27, 197, 189, 0.1);
    color: #1bc5bd;
}

.badge-completed {
    background: rgba(27, 197, 189, 0.2);
    color: #1bc5bd;
}

/* LOGO STYLES */
.company-logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.brand {
    justify-content: center;
    /* Center the logo in sidebar */
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Separator */
    margin-bottom: 20px;
}

/* --- MODAL STYLES --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    /* Overlay effect */
    display: none;
    /* Hidden by default */
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 80%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 90vh;
    /* Prevent overflowing screen */
    display: flex;
    flex-direction: column;
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}