* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "DejaVu Sans", Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}
.layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    background: #1f3b57;
    color: #fff;
    padding: 24px;
}
.brand {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}
.user-box {
    background: rgba(255,255,255,0.08);
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 24px;
    line-height: 1.5;
}
.menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.06);
}
.menu a:hover { background: rgba(255,255,255,0.14); }
.content {
    flex: 1;
    padding: 28px;
}
.card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    margin-bottom: 22px;
}
h1, h2, h3 { margin-top: 0; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.form-row-single {
    grid-template-columns: 1fr;
}
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}
input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
.btn {
    display: inline-block;
    padding: 11px 16px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}
.btn-primary { background: #0f766e; color: #fff; }
.btn-secondary { background: #334155; color: #fff; }
.btn-warning { background: #b45309; color: #fff; }
.btn-success { background: #15803d; color: #fff; }
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}
.flash {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 700;
}
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1d4ed8; }
.login-box {
    max-width: 460px;
    margin: 70px auto;
}
.status-new { background: #f8d7da; }
.status-processing { background: #fff3cd; }
.status-ordered { background: #ffe5b4; }
.status-sent { background: #d1e7dd; }
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
}
.actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.small { font-size: 13px; color: #475569; }
.date-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 700;
}
.date-chip-active {
    background: #0f766e;
    color: #fff;
}
.date-chip-count {
    display: inline-flex;
    min-width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.75);
    color: #0f172a;
    padding: 0 6px;
    font-size: 12px;
}
.date-chip-active .date-chip-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .section-head { flex-direction: column; }
}

.btn-danger { background: #b91c1c; color: #fff; }

.draft-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.draft-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
}
.draft-remove-form {
    flex-shrink: 0;
}


.admin-inline-form {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    margin: 0;
}
.admin-inline-form .admin-inline-status {
    width: 180px;
    flex: 0 0 180px;
}
.admin-inline-form .admin-inline-note {
    flex: 0 1 180px;
    min-width: 140px;
    max-width: 220px;
}
.admin-inline-form .admin-inline-submit {
    flex: 0 0 auto;
}
.admin-inline-form select,
.admin-inline-form input[type="text"] {
    margin: 0;
}
.admin-inline-form button {
    white-space: nowrap;
}
@media (max-width: 1100px) {
    .admin-inline-form {
        flex-wrap: wrap;
    }
    .admin-inline-form .admin-inline-status,
    .admin-inline-form .admin-inline-note,
    .admin-inline-form .admin-inline-submit {
        flex: 1 1 100%;
        width: 100%;
    }
}


.save-indicator {
    font-size: 12px;
    min-height: 16px;
    margin-top: 4px;
}
.save-indicator.saving { color: #1d4ed8; }
.save-indicator.saved { color: #15803d; }
.save-indicator.error { color: #b91c1c; }
.save-indicator.pending { color: #b45309; }


.ean-copy-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ean-text {
    font-weight: 700;
}
.btn-copy-ean {
    padding: 6px 10px;
    font-size: 12px;
}


.status-with-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #334155;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}
.status-info:hover {
    background: #334155;
    color: #fff;
}
.admin-inline-form .status-info {
    flex: 0 0 auto;
}


/* Stav + modré informační i v jednom řádku */
.status-with-info,
.admin-inline-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.status-info {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    border-radius: 999px !important;
    border: 0 !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: help;
    vertical-align: middle;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.status-info:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

.admin-inline-status select {
    flex: 0 0 auto;
}


/* Lepší rozestup mezi stavem a poznámkou v administraci */
.admin-inline-form {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: nowrap !important;
}

.admin-inline-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex: 0 0 235px !important;
    min-width: 235px !important;
    max-width: 235px !important;
}

.admin-inline-status select {
    width: 205px !important;
}

.admin-inline-note {
    margin-left: 8px !important;
    flex: 0 0 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
}

.admin-inline-note input[type="text"] {
    width: 210px !important;
}

@media (max-width: 1250px) {
    .admin-inline-form {
        flex-wrap: wrap !important;
    }

    .admin-inline-status,
    .admin-inline-note {
        flex: 1 1 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }

    .admin-inline-status select,
    .admin-inline-note input[type="text"] {
        width: 100% !important;
    }
}


/* Ovládání počtu kusů a poznámky v rozpracovaném listu */
.draft-item-main {
    flex: 1 1 260px;
}
.draft-controls-form {
    display: grid;
    grid-template-columns: auto;
    gap: 6px;
    min-width: 250px;
}
.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.qty-control input[type="text"] {
    width: 70px;
    text-align: center;
    padding: 8px 6px;
}
.qty-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: #334155;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}
.qty-btn:hover {
    background: #1f2937;
}
.draft-controls-form label {
    margin-bottom: 0;
    font-size: 13px;
}
@media (max-width: 900px) {
    .draft-item {
        flex-direction: column;
    }
    .draft-controls-form {
        width: 100%;
    }
}


/* Úprava uloženého počtu a odpověď prodejny */
.saved-qty-form,
.store-reply-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}
.saved-qty-form .qty-control {
    display: inline-flex;
}
.saved-qty-form .btn-small,
.store-reply-form .btn-small,
.btn-small {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 8px;
}
.store-reply-form input[type="text"] {
    min-width: 220px;
}


.saved-qty-form + .small,
td .small {
    line-height: 1.35;
}
