/* =========================
   HAUSPELLA SAAS UI v1 STABLE
   CLEAN DESIGN SYSTEM
========================= */

/* ROOT */
:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;

    --primary: #4f46e5;
    --border: #e5e7eb;

    --shadow: 0 6px 18px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
    background: var(--bg);
    color: var(--text);
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 16px;
}

.logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    transition: 0.15s ease;
}

.nav-item:hover {
    background: rgba(79,70,229,0.08);
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(79,70,229,0.12);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.danger {
    color: #ef4444;
}

/* =========================
   CONTENT
========================= */

.content {
    margin-left: 260px;
    padding: 32px;
    max-width: 1200px;
}

/* =========================
   GRID
========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.stat-card {
    grid-column: span 3;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

/* =========================
   CARDS
========================= */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-top: 16px;
}

/* =========================
   TABLE
========================= */

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

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    color: var(--muted);
    font-weight: 600;
}

/* =========================
   TYPOGRAPHY
========================= */

h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--muted);
}

/* =========================
   BUTTONS
========================= */

.menu-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}

.menu-btn:hover {
    background: #f9fafb;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1024px) {
    .stat-card {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        width: 220px;
    }

    .content {
        margin-left: 0;
        padding: 16px;
    }

    .stat-card {
        grid-column: span 12;
    }
}



/* =========================
   PRODUCT SELECTION
========================= */

.logo-link {
    text-decoration: none;
    color: var(--primary);
}

.toolbar {
    margin: 20px 0;
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.btn-primary:hover {

    transform: translateY(-1px);

    box-shadow: var(--shadow);

}

.btn-danger {

    background: #dc3545;
    color: white;

    padding: 8px 12px;

    border-radius: 6px;

    text-decoration: none;
}


.btn-delete-note {
    display: flex;
    align-items: center; /* Выравнивание по вертикали (по середине) */
    justify-content: flex-end; /* Прижимаем к правому краю */
    padding-right: 25px; /* Отступ справа 25px */

}

.btn-primary:hover {
    opacity: 0.9;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.selection-table {
    margin-top: 10px;
}

.selection-table th {
    white-space: nowrap;
}

.selection-table td {
    vertical-align: middle;
}

.section-title {
    margin-bottom: 16px;
}

.selection-table {
    overflow-x: auto;
}

.selection-table th {
    background: #fafafa;
}


/* =========================
   FORMS
========================= */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    display: inline-block;
    text-decoration: none;
    background: #f3f4f6;
    color: var(--text);
    padding: 10px 16px;
    border-radius: 10px;
}

.product-image-large {
    width: 120px;
    height: 160px;

    object-fit: cover;

    border-radius: 12px;

    border: 1px solid var(--border);
}


.supplier-product {
    display: flex;
    gap: 20px;
    align-items: center;
}


.group-header td {
    background: #eef2ff;
    font-weight: 600;
    padding: 12px;
    border-top: 2px solid #c7d2fe;
}

.final-cost td {
    font-weight: bold;
    background: #f0fdf4;
}


.base-cost td {
    background: #eff6ff;
}

.form-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 20px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}


.service-groups {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.service-group {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
}

.service-group h5 {
    margin-top: 0;
    margin-bottom: 15px;
}

.service-group label {
    display: block;
    margin-bottom: 12px;
    cursor: pointer;
}

.service-group input[type="checkbox"] {
    margin-right: 8px;
}


.note-actions {

    margin-top: 15px;

}

.btn-danger {

    display: inline-block;

    background: #dc3545;

    color: white;

    padding: 10px 16px;

    border-radius: 8px;

    text-decoration: none;

    font-weight: 600;

}.note-actions {

    margin-top: 15px;

    padding-top: 10px;

    border-top: 1px solid var(--border);

}

/* =======================================
   LOGIN
======================================= */

.login-container {

    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    background: var(--bg);

}

.login-card {

    width: 420px;

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 40px;

    box-shadow: 0 12px 30px rgba(0,0,0,.08);

}

.login-logo {

    margin: 0;

    text-align: center;

    font-size: 34px;

}

.login-subtitle {

    text-align: center;

    color: var(--muted);

    margin-bottom: 35px;

}

.login-card h2 {

    text-align: center;

    margin-bottom: 25px;

}

.login-card form p {

    display: flex;

    flex-direction: column;

    margin-bottom: 18px;

}

.login-card label {

    margin-bottom: 8px;

    font-weight: 600;

}

.login-card input {

    padding: 12px;

    border-radius: 10px;

    border: 1px solid var(--border);

    background: var(--card);

    color: var(--text);

    width: 100%;

    font-size: 15px;

    transition: .2s;
}

.login-card input:focus {

    outline: none;

    border-color: var(--primary);

    box-shadow: 0 0 0 4px rgba(79,70,229,.15);

}

.login-card button {

    width: 100%;

    margin-top: 15px;

}

.error-message {

    background: #ffe7e7;

    color: #b40000;

    border-radius: 10px;

    padding: 12px;

    margin-bottom: 20px;

    text-align: center;

}


.login-card {

    text-align: center;

}

.login-card form {

    text-align: left;

}

.login-logo {

    font-size: 42px;

    color: var(--primary);

    margin-bottom: 8px;

    font-weight: 800;

}

.login-subtitle {

    font-size: 15px;

    margin-bottom: 35px;

}

/* =======================================
   USER PANEL
======================================= */

.top-bar {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 25px;

    width: 100%;

}

.top-bar-left {

    display: flex;

    gap: 10px;

    align-items: center;

}

.user-panel {

    display: flex;

    align-items: center;

    gap: 12px;

}

.user-panel form {

    margin: 0;

}

.user-name {

    font-weight: 600;

    color: var(--text);

}