/* Каркас — как в crm.body-pillow.ru; таблица заказов и попапы — как на work.body-pillow.ru. */
:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --text: #1d2330;
    --muted: #6b7385;
    --line: #e2e5eb;
    --accent: #2f6fde;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 24px 0 8px; }

.top {
    display: flex; align-items: center; gap: 20px;
    padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); }
.top nav { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.top nav a { padding: 5px 12px; border-radius: 6px; color: var(--text); }
.top nav a:hover { background: var(--bg); text-decoration: none; }
.top nav a.active { background: var(--accent); color: #fff; }
.top form { margin: 0; }
.user { color: var(--muted); }
main { max-width: 1600px; margin: 0 auto; padding: 20px 16px 60px; }

.empty, .muted { color: var(--muted); }
.flash { padding: 10px 14px; margin-bottom: 16px; border-radius: 8px; background: #fff4d6; color: #5c4400; }

.btn-plain {
    padding: 5px 12px; font: inherit; cursor: pointer;
    background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
}

/* Вход */
.login { max-width: 340px; margin: 40px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.login h1 { margin-bottom: 16px; }
.login label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.login input {
    width: 100%; margin-top: 4px; padding: 7px 8px; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
}
.login .btn { width: 100%; }
.error { color: #c0392b; margin: 0 0 12px; }

/* Швеи */
.section-heading { margin-top: 40px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { padding: 6px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.tabs a span { color: var(--muted); margin-left: 4px; }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs a.active span { color: rgba(255, 255, 255, .8); }
.tabs a:hover { text-decoration: none; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: var(--bg); }
table.list td.title { min-width: 240px; word-break: break-word; }
table.list td.num { white-space: nowrap; color: var(--muted); }
table.list tr.off td { color: var(--muted); }

/* Заказы — как на work.body-pillow.ru/zakazy/ */
.table-zakazy-wrapper { overflow-x: auto; background: var(--panel); }

.input--print-orders--qty { width: 3em; margin: 0; }

#block-add-products { margin: 1em 0; }
.button-add-product-wrapper { margin-bottom: 0.5em; }
#block-add-products .added-product { display: flex; align-items: end; gap: 1em; }
#block-add-products .added-product:not(:last-child) { margin-bottom: 1em; }
#block-add-products .added-product .select-product-wrapper { width: 36em; max-width: calc(100% - 8em); }
#block-add-products .added-product .input-search-product,
#block-add-products .added-product .select-product { width: 100%; }

#table-zakazy tbody tr.priority-urgent { background: #ffffe0; }
#table-zakazy tbody tr.priority-super-urgent { background: #ffc0cb; }
#table-zakazy tbody tr.priority-pause { background: #888; }
#table-zakazy tbody tr:hover { box-shadow: inset 0 100vh rgba(0, 0, 0, 0.1); }

#table-zakazy .column-product-title { min-width: 16em; }
#table-zakazy tbody .column-product-title { cursor: pointer; }
#table-zakazy tbody .column-product-title .executive-production {
    margin-right: 0.5em;
    color: #ffd700;
    text-shadow:
        -1px -1px 0 #daa520, -1px 0 0 #daa520, -1px 1px 0 #daa520, 0 -1px 0 #daa520,
        0 1px 0 #daa520, 1px -1px 0 #daa520, 1px 0 0 #daa520, 1px 1px 0 #daa520;
}
#table-zakazy .package-description { color: #9c2ad5; }
#table-zakazy .button-corrections-wrapper { margin-top: 0.5em; }
#table-zakazy .button-corrections { cursor: pointer; }
#table-zakazy .button-close-order { width: 6em; }
#table-zakazy .order-comment { margin-bottom: 1em; white-space: pre-wrap; }
#table-zakazy .input-comment-wrapper { display: flex; justify-content: space-between; align-items: start; width: 25.5em; }
#table-zakazy .input-comment { width: 22em; }
#table-zakazy .input-comment.changed { background: #f9f9d2; }

table.dataTable { margin-top: 0 !important; margin-bottom: 0 !important; }
.dtfh-floatingparent.dtfh-floatingparenthead { background: #f5f5f5; box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.5); }

/* Попапы — common.css work */
.work-popup {
    display: none; /* Попап скрыт, пока не будет показан через javascript */
    position: fixed; z-index: 999; top: 50%; left: 50%;
    min-width: 100px; min-height: 60px; max-width: calc(100vw - 20px); max-height: calc(100vh - 20px);
    transform: translate(-50%, -50%);
    border-radius: 5px; background: #fff; box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
}
.work-popup .button-close-popup {
    position: absolute; top: 0; right: 0; width: 30px; height: 30px;
    border: none; border-radius: 5px; padding: 0; font-size: 16px; line-height: 30px;
    background: #fff; color: #000; text-align: center; cursor: pointer;
}
.work-popup .button-close-popup:hover { background: #e5e5e5; }
.work-popup .button-close-popup .fa { line-height: inherit; }
.work-popup .popup-heading {
    position: absolute; top: 0; left: 0; right: 30px; height: 30px; overflow: hidden;
    padding: 0 10px; font-size: 20px; line-height: 30px; white-space: nowrap; text-overflow: ellipsis;
}
.work-popup .popup-content { max-height: calc(100vh - 50px); overflow: auto; margin-top: 30px; padding: 10px; }

#popup-product-details { width: 800px; }
#popup-product-details .loading .fa { margin-right: 0.5em; }
#popup-product-details .main-content { display: flex; margin-bottom: 10px; }
#popup-product-details .main-image-wrapper { width: 258px; max-width: 35%; }
#popup-product-details .main-image { width: 100%; }
#popup-product-details .details { flex-grow: 1; margin-left: 10px; }
#popup-product-details .details-heading { font-size: 18px; font-weight: bold; }
#popup-product-details .additional-images { display: flex; }
#popup-product-details .additional-images > * { max-width: 129px; }
#popup-product-details .additional-images > *:not(:last-child) { margin-right: 10px; }
#popup-product-details .additional-images img { width: 100%; }

#table-zakazy tbody .column-order-code { cursor: pointer; }

#popup-order-details { width: 800px; }
#popup-order-details .loading .fa { margin-right: 0.5em; }
#popup-order-details .details-heading { font-size: 20px; font-weight: bold; }

#popup-corrections { width: 600px; }
#popup-corrections .loading .fa { margin-right: 0.5em; }
#input-corrections { width: 100%; }

#form-print-orders { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em; }
#form-print-orders .select-seamstress { width: auto; min-width: 18em; }

.filter { margin-bottom: 16px; }
.filter .form-select { width: auto; min-width: 20em; }
table.list .text-end { text-align: right; }

/* Оплаты — как на work.body-pillow.ru/payments/ */
.filter-row { display: flex; flex-wrap: wrap; align-items: end; gap: 1em; margin-bottom: 1em; }
.filter-row .form-select, .filter-row .form-control { width: auto; }
#table-payments { background: var(--panel); }
#table-payments tr.correction-plus { font-weight: bold; color: #2d89ef; }
#table-payments tr.correction-minus { font-weight: bold; color: #eb3c00; }
#table-payments td.separator { border-top-width: 3px; }
#table-payments tr.tr-productor td { font-weight: bold; background: var(--bg); border-top-width: 3px; }
.form-download-upd { margin-top: 0.5em; }
