/* ==========================================================================
   Settings: panels, data tables, small buttons (User Management)
   ========================================================================== */

.settings-stack { display: flex; flex-direction: column; gap: 16px; max-width: 1200px; margin: 0 auto; padding-bottom: 12px; }

.panel {
    background: rgba(255,255,255,.95);
    border: 1px solid #E3E8F2;
    border-top: 4px solid transparent;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 12px 28px -18px rgba(20,30,50,.25), 0 2px 6px rgba(20,30,50,.04);
    background:
        linear-gradient(rgba(255,255,255,.97), rgba(255,255,255,.97)) padding-box,
        linear-gradient(90deg, #3B6FE0, #8DB0FF) top / 100% 4px no-repeat border-box,
        linear-gradient(#E3E8F2, #E3E8F2) border-box;
}
.panel.attention {
    background:
        linear-gradient(rgba(255,255,255,.97), rgba(255,255,255,.97)) padding-box,
        linear-gradient(90deg, #E14D63, #FF9AA8) top / 100% 4px no-repeat border-box,
        linear-gradient(#F1D3D9, #F1D3D9) border-box;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.panel-head p { font-size: 12px; color: var(--muted); margin: 0; }
.panel-head .count { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: #EAF0FE; color: var(--blue); }
.panel.attention .panel-head .count { background: var(--red-bg); color: var(--red); }
.panel-empty { padding: 22px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed #D6DEEC; border-radius: 10px; background: #FAFBFE; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 10px 8px; border-bottom: 1px solid #E6EBF4; }
.data-table td { padding: 10px; border-bottom: 1px solid #EEF1F7; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #F8FAFE; }
.data-table tr.disabled td { color: #A3AEC4; }
.data-table tr.disabled b { color: #8C97AE; }
.data-table .muted { color: var(--muted); font-size: 12px; white-space: nowrap; }
.data-table .muted small { display: block; font-size: 11px; color: #A3AEC4; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn + .btn { margin-left: 6px; }
.data-table .you { margin-left: 8px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: #EAF0FE; color: var(--blue); vertical-align: 1px; }
.data-table .confirm { font-size: 12px; color: var(--red); margin-right: 8px; }

/* Controls */
.select {
    font: inherit; font-size: 12.5px; color: var(--text);
    padding: 6px 28px 6px 10px;
    border: 1px solid #DCE3EF; border-radius: 8px;
    background: #F7F9FC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237C8AA3' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none; -webkit-appearance: none;
    cursor: pointer;
}
.select:focus { outline: none; border-color: #3B6FE0; box-shadow: 0 0 0 3px rgba(59,111,224,.14); background-color: #FFFFFF; }
.select:disabled { cursor: not-allowed; opacity: .6; }

.btn {
    font: inherit; font-size: 12.5px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px;
    border: 1px solid transparent; cursor: pointer;
    transition: filter .12s ease, background .12s ease, border-color .12s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-approve { color: #FFFFFF; background: linear-gradient(135deg, #1FAE68, #39C985); box-shadow: 0 6px 14px -6px rgba(31,174,104,.6); }
.btn-approve:hover:not(:disabled) { filter: brightness(1.05); }
.btn-danger { color: #FFFFFF; background: linear-gradient(135deg, #E14D63, #F06C80); }
.btn-ghost { color: var(--muted); background: #FFFFFF; border-color: #DCE3EF; }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: #C5D0E3; background: #F7F9FC; }
.btn-ghost.danger:hover:not(:disabled) { color: var(--red); border-color: #F4C6CE; background: #FFF7F8; }

/* Production Orders form */
.po-form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; }
.po-field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.po-field.wide { grid-column: span 2; }
.po-field.full { grid-column: 1 / -1; }
.po-field small { text-transform: none; letter-spacing: 0; font-weight: 500; color: #A3AEC4; }
.po-field .select { width: 100%; }
.input-sm {
    font: inherit; font-size: 13px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500;
    padding: 6px 10px; border: 1px solid #DCE3EF; border-radius: 8px; background: #F7F9FC; width: 100%; min-width: 0;
}
.input-sm:focus { outline: none; border-color: #3B6FE0; box-shadow: 0 0 0 3px rgba(59,111,224,.14); background: #FFFFFF; }
.input-sm:disabled { opacity: .65; }
.po-stations { display: flex; flex-wrap: wrap; gap: 8px; }
.po-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text); text-transform: none; letter-spacing: 0; padding: 5px 10px; border: 1px solid #DCE3EF; border-radius: 8px; background: #FFFFFF; cursor: pointer; }
.po-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.table-scroll { overflow-x: auto; }
.data-table .nowrap { white-space: nowrap; }
@media (max-width: 900px) {
    .po-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .po-field.wide { grid-column: 1 / -1; }
}

/* Result banner */
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; }
.notice.ok { background: var(--green-bg); border-color: #BDE8D2; color: #157A49; }
.notice.err { background: var(--red-bg); border-color: #F4C6CE; color: #B4364A; }
.notice-close { border: 0; background: transparent; font-size: 18px; line-height: 1; color: inherit; cursor: pointer; opacity: .7; }
.notice-close:hover { opacity: 1; }

/* Header user chip role suffix */
.page-header .chip .role { color: var(--muted); }

@media (max-width: 900px) {
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 10px 0; border-bottom: 1px solid #EEF1F7; }
    .data-table td { border: 0; padding: 4px 0; }
    .data-table .actions { text-align: left; padding-top: 8px; }
}
