/* Заказы поставщикам — стили */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    color: #333;
}

/* --- Login --- */
.login-page {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}
.login-card h1 { font-size: 22px; color: #333; margin-bottom: 6px; }
.login-card p { color: #888; font-size: 14px; margin-bottom: 24px; }
.login-card select, .login-card input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}
.login-card select:focus, .login-card input:focus { border-color: #2e7d32; }
.login-card button {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}
.login-card button:hover { opacity: 0.95; }
.error { color: #e74c3c; font-size: 14px; margin-top: 12px; }
.logo { font-size: 44px; margin-bottom: 12px; }

/* --- Header --- */
.header {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 { font-size: 18px; font-weight: 600; }
.header .dept { font-size: 14px; opacity: 0.85; }
.header a { color: white; text-decoration: none; font-size: 14px; opacity: 0.8; }
.header a:hover { opacity: 1; }

/* --- Form page --- */
.container { max-width: 700px; margin: 20px auto; padding: 0 16px; }
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card h2 { font-size: 16px; margin-bottom: 12px; color: #333; }
.date-display { font-size: 14px; color: #666; margin-bottom: 16px; }

/* --- Search input --- */
.search-wrap { position: relative; }
.search-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}
.search-input:focus { border-color: #2e7d32; }
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.search-dropdown.show { display: block; }
.search-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}
.search-item:hover { background: #e8f5e9; }
.search-item .inn { color: #999; font-size: 12px; }

/* --- Tags --- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tag .remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: #c62828;
    line-height: 1;
}
.tag .remove:hover { color: #b71c1c; }

/* --- Buttons --- */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: #2e7d32; color: white; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { margin-top: 16px; display: flex; gap: 10px; }

/* --- Checkbox --- */
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}
.checkbox-wrap input[type="checkbox"] { width: 18px; height: 18px; accent-color: #2e7d32; }

/* --- Today orders --- */
.today-list { margin-top: 12px; }
.today-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.today-item:last-child { border-bottom: none; }
.today-item .remove-saved {
    color: #c62828;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
}

/* --- Hint текст --- */
.hint {
    color: #888;
    font-size: 13px;
    margin: 4px 0 14px 0;
}

/* --- Сохранённый список (новый стиль) --- */
.saved-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.saved-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e8f5e9;
    padding: 10px 12px 10px 16px;
    border-radius: 10px;
    font-size: 15px;
    color: #1b5e20;
    animation: fadeIn 0.25s ease;
    transition: all 0.2s;
}
.saved-item-new {
    animation: slideIn 0.35s ease;
}
.saved-item-removing {
    opacity: 0;
    transform: translateX(20px);
}
.saved-name { flex: 1; }
.saved-remove {
    background: transparent;
    border: none;
    color: #c62828;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.15s;
}
.saved-remove:hover {
    background: rgba(198,40,40,0.1);
}

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

/* --- Двухколоночный layout --- */
.layout-two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    align-items: start;
}
.col-main { min-width: 0; }
.col-side { min-width: 0; }

@media (max-width: 800px) {
    .layout-two-col {
        grid-template-columns: 1fr;
    }
    .col-side { order: 2; }
}

/* --- Бокс "Нет заказов" справа --- */
.no-orders-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid #ffe0b2;
    transition: all 0.3s;
}
.no-orders-box.active {
    background: #e8f5e9;
    border-color: #66bb6a;
}
.no-orders-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.no-orders-box.active .no-orders-title {
    color: #1b5e20;
}
.no-orders-desc {
    font-size: 13px;
    color: #777;
    margin-bottom: 14px;
    line-height: 1.4;
}
.no-orders-btn {
    width: 100%;
    padding: 12px 16px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    min-height: 44px;
}
.no-orders-btn:hover:not(.loading) {
    background: #f57c00;
}
.no-orders-box.active .no-orders-btn {
    background: #2e7d32;
    cursor: default;
    pointer-events: none;
}
.no-orders-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}
.no-orders-btn.loading .no-orders-btn-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.no-orders-hint {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    line-height: 1.4;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Поисковые элементы доп. --- */
.search-item.already {
    opacity: 0.55;
    color: #888;
}
.search-item .badge {
    background: #2e7d32;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 4px;
    text-transform: uppercase;
}
.search-item.empty {
    color: #999;
    font-style: italic;
    cursor: default;
}
.search-item.empty:hover {
    background: transparent;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-width: 80%;
    text-align: center;
    pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    background: #c62828;
}

/* --- Dashboard --- */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 13px; color: #666; }
.filter-group input, .filter-group select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: #f5f5f5; padding: 10px 12px; text-align: left; font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid #eee; }
tr.no-orders td { color: #999; font-style: italic; }
tr.not-reported td { color: #e65100; background: #fff3e0; }

/* --- Messages --- */
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.msg-success { background: #e8f5e9; color: #2e7d32; }
.msg-error { background: #ffebee; color: #c62828; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .container { padding: 0 10px; }
    .card { padding: 16px; }
    .filters { flex-direction: column; }
    .header h1 { font-size: 16px; }
}
