/* TFP RMA admin — layered on top of style.css */

body.admin {
    background: #f4f6f9;
}

.admin-header {
    background: #fff;
    border-bottom: 1px solid var(--tfp-border);
    padding: 12px 0;
    margin-bottom: 24px;
}
.admin-container {
    max-width: 1280px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-container .brand {
    text-decoration: none;
}
.admin-container h2 {
    font-size: 1.1rem;
}

main.admin-container {
    display: block;
    padding-bottom: 60px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.88rem;
}

.admin-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.admin-nav a {
    color: var(--tfp-dark);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.92rem;
}
.admin-nav a:hover {
    background: #eef3f9;
    color: var(--tfp-blue);
}
.admin-user-chip {
    background: #eef3f9;
    color: var(--tfp-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
}
.admin-user-chip small {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--tfp-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.alert-info {
    background: #eef3f9;
    border: 1px solid #b6d0e8;
    color: var(--tfp-dark);
}

.status-admin       { background: #d6e8fa; color: #0a4d8c; }
.status-technician  { background: #e2e3e5; color: #383d41; }

.required-star { color: var(--tfp-error); margin-left: 2px; }
.hint { color: var(--tfp-muted); font-size: 0.85rem; }

/* --- bulk actions in admin list ------------------------------------- */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--tfp-border);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--tfp-muted);
}
.bulk-bar #rma-selected-count {
    color: var(--tfp-dark);
    font-weight: 600;
    min-width: 1.6em;
    display: inline-block;
    text-align: right;
}
.col-checkbox {
    width: 32px;
    text-align: center;
    cursor: default !important;
}
.col-checkbox input[type="checkbox"] {
    cursor: pointer;
    transform: scale(1.15);
}

.btn-danger {
    background: var(--tfp-error);
    color: #fff;
    border: 1px solid var(--tfp-error);
}
.btn-danger:hover:not(:disabled) {
    background: #a02d20;
    border-color: #a02d20;
}
.btn-danger:disabled {
    background: #d9aaa2;
    border-color: #d9aaa2;
    cursor: not-allowed;
}

.btn-success {
    background: var(--tfp-ok);
    color: #fff;
    border: 1px solid var(--tfp-ok);
}
.btn-success:hover:not(:disabled) {
    background: #1f8b4c;
    border-color: #1f8b4c;
    color: #fff;
}

.admin-login-card {
    max-width: 420px;
    margin: 60px auto;
}

.login-back-home {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--tfp-border);
}
.login-back-home a {
    color: var(--tfp-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.login-back-home a:hover {
    color: var(--tfp-blue);
    text-decoration: underline;
}

.admin-filters .filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
}
@media (max-width: 900px) {
    .admin-filters .filter-row { grid-template-columns: 1fr 1fr; }
}
.filter-col label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tfp-dark);
    margin-bottom: 4px;
}
.filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}
.admin-table th {
    text-align: left;
    padding: 10px 12px;
    background: #eef3f9;
    color: var(--tfp-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--tfp-border);
}
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--tfp-border);
    vertical-align: top;
}
.admin-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}
.admin-table tbody tr:hover {
    background: #f7f9fc;
}
.admin-table td.empty {
    text-align: center;
    color: var(--tfp-muted);
    padding: 40px 12px;
}
.admin-table .mono {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.85rem;
}

.status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e8eef7;
    color: var(--tfp-dark);
    white-space: nowrap;
}
.status-nová             { background: #d6e8fa; color: #0a4d8c; }
.status-přijato          { background: #f4e6ce; color: #8c5a0a; }
.status-diagnostika      { background: #e6dbef; color: #5e3a8c; }
.status-čeká-na-schválení { background: #ffe9b0; color: #8c5a0a; }
.status-v-opravě         { background: #fff3cd; color: #856404; }
.status-čeká-na-náhradní-díl { background: #f5d7c1; color: #7a3e10; }
.status-vyřízeno         { background: #d4edda; color: #155724; }
.status-expedováno       { background: #cfeaf5; color: #0c5a72; }
.status-zamítnuto        { background: #f8d7da; color: #721c24; }
.status-zrušeno          { background: #e2e3e5; color: #383d41; }

.pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.page-link {
    padding: 6px 12px;
    border: 1px solid var(--tfp-border);
    border-radius: 4px;
    background: #fff;
    color: var(--tfp-blue);
    text-decoration: none;
    font-size: 0.88rem;
}
.page-link:hover { background: #eef3f9; }
.page-link.active {
    background: var(--tfp-blue);
    color: #fff;
    border-color: var(--tfp-blue);
}

.detail-head {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) { .detail-head { grid-template-columns: 1fr 1fr; } }
.detail-head .muted {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tfp-muted);
    margin-bottom: 4px;
}
.detail-head-select {
    padding: 4px 8px;
    font-size: 0.95rem;
    height: auto;
    width: 100%;
    max-width: 220px;
}

.status-form .form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}
.status-form .grow { flex: 1; }
.status-form .grow-2 { flex: 2; }
@media (max-width: 700px) { .status-form .form-row { flex-direction: column; align-items: stretch; } }

.detail-grid h3 {
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--tfp-border);
    color: var(--tfp-dark);
    font-size: 1.05rem;
}
.detail-grid h3:first-child { margin-top: 0; }
.detail-grid dl {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 8px 18px;
    margin: 0;
}
@media (max-width: 600px) {
    .detail-grid dl { grid-template-columns: 1fr; gap: 4px 0; }
    .detail-grid dt { font-weight: 600; margin-top: 8px; }
}
.detail-grid dt {
    font-weight: 600;
    color: var(--tfp-dark);
}
.detail-grid dd { margin: 0; }
.detail-grid .mono.small { font-size: 0.78rem; word-break: break-all; }
.detail-grid .text-error { color: var(--tfp-error); }

ul.attachments {
    margin: 0; padding: 0; list-style: none;
}
ul.attachments li {
    padding: 8px 0;
    border-bottom: 1px solid var(--tfp-border);
}
ul.attachments li:last-child { border-bottom: none; }
ul.attachments a {
    color: var(--tfp-blue);
    text-decoration: none;
    font-weight: 600;
}
ul.attachments a:hover { text-decoration: underline; }
ul.attachments small { display: block; }

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