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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Страница логина */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.landing-container {
    width: 100%;
    max-width: 450px;
}

.landing-header {
    text-align: center;
    margin-bottom: 30px;
}

.landing-header h1 {
    color: #6a1b9a;
    font-size: 28px;
    margin-bottom: 8px;
}

.landing-subtitle {
    color: #757575;
    font-size: 16px;
}

.auth-block {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.auth-tabs {
    display: flex;
}

.auth-tab {
    flex: 1;
    padding: 14px;
    border: none;
    background: #f5f5f5;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: #757575;
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    color: #6a1b9a;
    box-shadow: 0 -2px 0 #6a1b9a inset;
}

.auth-form {
    padding: 30px;
}

.success-message {
    color: #2e7d32;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

.admin-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #6a1b9a;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #6a1b9a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button[type="submit"]:hover {
    background: #4a148c;
}

.error-message {
    color: #d32f2f;
    margin-top: 10px;
    text-align: center;
}

/* Dashboard */
.header {
    background: white;
    padding: 16px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header h1 {
    color: #6a1b9a;
    font-size: clamp(16px, 2.5vw, 24px);
    white-space: nowrap;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Вкладки */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tab {
    flex: 1 1 200px;
    padding: 16px 20px;
    background: #ffe0b2;
    border: 2px solid #ffb74d;
    border-radius: 8px;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 600;
    color: #e65100;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tab:hover {
    background: #ffcc80;
}

.tab.active {
    background: #ff9800;
    border-color: #f57c00;
    color: white;
}

.tab-content {
    display: none;
}

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

.cargo-placeholder {
    background: white;
    border-radius: 8px;
    padding: 60px;
    text-align: center;
    color: #757575;
    font-size: 18px;
}

.cargo-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.order-history-cell {
    text-align: center;
    font-weight: 500;
    color: #388e3c;
    position: relative;
    white-space: nowrap;
}

.total-ordered-cell {
    text-align: center;
    font-weight: 600;
    color: #e65100;
}

.total-will-cell {
    text-align: center;
    font-weight: 600;
    color: #333;
}

.total-will-red {
    background: #ffcdd2;
}

.total-will-yellow {
    background: #fff9c4;
}

.total-will-green {
    background: #c8e6c9;
}

.am-cell {
    text-align: center;
    padding: 4px;
}

.am-header {
    width: 40px;
    text-align: center;
}

.star {
    cursor: pointer;
    font-size: 20px;
    color: #e0e0e0;
    transition: color 0.2s;
    user-select: none;
}

.star:hover {
    color: #ffd54f;
}

.star-active {
    color: #ffc107;
}

.fav-row {
    background: #fffde7;
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background: transparent;
}

.resize-handle:hover {
    background: rgba(106, 27, 154, 0.3);
}

.photo-tooltip {
    display: none;
    position: absolute;
    z-index: 2000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    padding: 5px;
    pointer-events: none;
}

.photo-tooltip img {
    max-width: 300px;
    max-height: 300px;
    border-radius: 6px;
    display: block;
}

.name-cell {
    cursor: pointer;
}

.photo-tooltip {
    pointer-events: auto;
}

.btn-edit-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #9e9e9e;
    padding: 2px 4px;
    margin-left: 4px;
    border-radius: 3px;
    transition: all 0.2s;
}

.btn-edit-item:hover {
    color: #1565c0;
    background: #e3f2fd;
}

.order-date-header {
    white-space: nowrap;
}

.date-picker-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.btn-calendar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 1px 3px;
    margin-left: 2px;
    border-radius: 3px;
    transition: all 0.2s;
}

.btn-calendar:hover {
    background: rgba(255,255,255,0.3);
}

.btn-delete-order {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: #e0e0e0;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 3px;
    transition: all 0.2s;
}

.btn-delete-order:hover {
    color: white;
    background: #d32f2f;
}

.top-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 300px;
}

.summary-block {
    background: rgb(255, 242, 242);
    border: 1px solid rgb(255, 200, 200);
    border-radius: 8px;
    padding: 15px 20px;
    min-width: 0;
    flex: 0 1 320px;
    font-size: 14px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    gap: 20px;
}

.summary-row span:last-child {
    font-weight: 600;
    white-space: nowrap;
}

.summary-total {
    font-weight: 600;
    color: #6a1b9a;
}

.summary-divider {
    border-top: 1px solid rgb(255, 200, 200);
    margin: 8px 0;
}

.control-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.update-info {
    color: #757575;
    font-size: 14px;
}

.btn-primary {
    background: #6a1b9a;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.btn-primary:hover {
    background: #4a148c;
}

.btn-primary:disabled,
.btn-fbo:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-fbo {
    background: #1565c0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.btn-fbo:hover {
    background: #0d47a1;
}

.btn-prices {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.btn-prices:hover {
    background: #1b5e20;
}

.btn-prices:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-save {
    background: #ff6f00;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.btn-save:hover {
    background: #e65100;
}

.btn-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #bdbdbd;
}

.price-cell {
    text-align: right;
    font-weight: 500;
}

.discount-cell {
    text-align: center;
    font-weight: 600;
    color: #d32f2f;
}

.btn-secondary {
    background: #757575;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-settings {
    background: #5c6bc0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-settings:hover {
    background: #3f51b5;
}

.btn-user {
    background: #00897b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-user:hover {
    background: #00695c;
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

#cargoTable {
    table-layout: fixed;
    font-size: 12px;
}

#cargoTable th {
    font-size: 12px;
}

#allProductsTable {
    table-layout: fixed;
}

thead {
    background: #f5f5f5;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th {
    font-weight: 600;
    color: #6a1b9a;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px;
    transition: background 0.2s;
}

th:hover {
    background: #ede7f6;
}

th::after {
    content: '⇅';
    position: absolute;
    right: 6px;
    opacity: 0.3;
    font-size: 12px;
}

th.sort-asc::after {
    content: '▲';
    opacity: 0.8;
}

th.sort-desc::after {
    content: '▼';
    opacity: 0.8;
}

.stock-cell {
    font-weight: 600;
    color: #1976d2;
}

.ordered-cell {
    font-weight: 600;
    color: #388e3c;
}

.order-input {
    width: 50px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}

.btn-add {
    background: #388e3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-add:hover {
    background: #2e7d32;
}

.btn-history {
    background: #1976d2;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-history:hover {
    background: #1565c0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #757575;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 24px;
    border-radius: 8px;
    width: 92%;
    max-width: 700px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #757575;
}

.close:hover {
    color: #333;
}

.history-table {
    margin-top: 20px;
}

#lastUpdate {
    color: #757575;
    font-size: 14px;
}

/* Global image rule */
img {
    max-width: 100%;
    height: auto;
}

/* Base responsive breakpoints */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header h1 {
        font-size: 16px;
    }

    .top-panel {
        flex-direction: column;
    }

    .summary-block {
        flex: 1 1 100%;
    }

    .cargo-header {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 96%;
        margin: 2% auto;
        padding: 16px;
    }

    .admin-section {
        padding: 12px;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .tabs {
        flex-direction: column;
    }

    .control-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   Интеграции: локальные стили апреля удалены.

   Раздел переведён на общую дизайн-систему: композиция страниц —
   css/integrations.css, контролы — css/components.css, диалоги —
   NeoitHub.modal. Классы `.int-page-*`, `.int-info-panel`,
   `.int-modal*` и `.int-card-badge-primary` не используются ни на
   одной странице проекта.

   @see .kiro/specs/integrations-architecture.md
   ============================================================ */


/* === SaaS Upgrade Modal === */
.upgrade-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: upgradeModalFadeIn 0.2s ease;
}
@keyframes upgradeModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.upgrade-modal-box {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: upgradeModalSlideUp 0.3s ease;
}
@keyframes upgradeModalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.upgrade-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.upgrade-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
}
.upgrade-modal-message {
    font-size: 14px;
    color: #757575;
    margin: 0 0 16px;
    line-height: 1.5;
}
.upgrade-modal-plan {
    background: #f3e5f5;
    color: #6a1b9a;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}
.upgrade-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.upgrade-modal-btn-primary {
    background: #6a1b9a;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.upgrade-modal-btn-primary:hover {
    background: #4a148c;
}
.upgrade-modal-btn-secondary {
    background: #f5f5f5;
    color: #757575;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.upgrade-modal-btn-secondary:hover {
    background: #e0e0e0;
}
