/* Radnik tablet dashboard */
.rn-worker-wrap {
    --rn-w-primary: #2563eb;
    --rn-w-warning: #ea580c;
    --rn-w-warning-bg: #ffedd5;
    --rn-w-border: #d1d5db;
    --rn-w-bg: #f3f4f6;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    color: #111827;
}

.rn-worker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.rn-worker-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.rn-worker-login {
    max-width: 420px;
    margin: 40px auto;
    padding: 28px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.rn-worker-login .rn-form-group {
    margin-bottom: 16px;
}

.rn-worker-login label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.rn-worker-login input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--rn-w-border);
    border-radius: 8px;
}

.rn-btn-touch {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.rn-btn-primary {
    background: var(--rn-w-primary);
    color: #fff;
}

.rn-btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.rn-btn-warning {
    background: var(--rn-w-warning);
    color: #fff;
}

.rn-btn-info {
    background: #2563eb;
    color: #fff;
}

.rn-worker-dashboard {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    min-height: 70vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--rn-w-border);
}

.rn-worker-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    padding: 20px;
    align-content: start;
    background: var(--rn-w-bg);
}

.rn-worker-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 100px;
    padding: 18px;
    background: #fff;
    border: 2px solid var(--rn-w-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.rn-worker-card:active {
    transform: scale(0.98);
}

.rn-worker-card.is-new {
    background: #dbeafe;
    border-color: #60a5fa;
}

.rn-worker-card.is-urgent {
    background: #ede9fe;
    border-color: #a78bfa;
}

.rn-worker-card.is-urgent.is-needs-material {
    background: #ede9fe;
    border-color: #ea580c;
    border-width: 3px;
}

.rn-worker-card.is-needs-material:not(.is-urgent) {
    background: var(--rn-w-warning-bg);
    border-color: var(--rn-w-warning);
}

.rn-worker-card-number {
    font-size: 1.15rem;
    font-weight: 700;
    word-break: break-all;
}

.rn-worker-card-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--rn-w-warning);
}

.rn-worker-card-badge.is-new-badge {
    color: #1d4ed8;
}

.rn-worker-card-badge.is-urgent-badge {
    color: #6d28d9;
}

.rn-btn-urgent {
    background: #7c3aed;
    color: #fff;
}

.rn-btn-urgent.is-on {
    background: #5b21b6;
    box-shadow: inset 0 0 0 2px #ddd6fe;
}

.rn-worker-sidebar {
    border-left: 3px solid #9ca3af;
    padding: 20px 16px;
    background: #fff;
    overflow: visible;
    max-height: none;
    position: static;
    align-self: start;
}

.rn-worker-sidebar-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.rn-worker-sidebar-head h3 {
    margin: 0;
}

.rn-btn-print-garments {
    font-size: 0.85rem !important;
    padding: 8px 12px !important;
    min-height: 0 !important;
    white-space: nowrap;
}

.rn-worker-sidebar h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #374151;
}

.rn-worker-garment-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.rn-worker-garment-list li.rn-garment-row {
    position: relative;
    display: block;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.92rem;
}

.rn-garment-trigger {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 10px 0;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.rn-garment-trigger:hover,
.rn-garment-row.is-open .rn-garment-trigger {
    color: #1d4ed8;
}

.rn-worker-garment-list .rn-g-label {
    flex: 1;
    line-height: 1.35;
}

.rn-garment-popover {
    position: absolute;
    right: 0;
    top: calc(100% - 4px);
    z-index: 40;
    min-width: 220px;
    max-width: min(320px, 90vw);
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.rn-garment-row:hover .rn-garment-popover,
.rn-garment-row.is-open .rn-garment-popover {
    display: block;
}

.rn-garment-popover[hidden] {
    display: none !important;
}

.rn-garment-row:hover .rn-garment-popover[hidden],
.rn-garment-row.is-open .rn-garment-popover[hidden] {
    display: block !important;
}

.rn-garment-popover-title {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.rn-garment-order-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rn-garment-order-links li + li {
    margin-top: 4px;
}

.rn-garment-order-links a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #111;
    background: #f3f4f6;
    font-weight: 600;
    min-height: 40px;
    align-items: center;
}

.rn-garment-order-links a:hover {
    background: #dbeafe;
    color: #1e40af;
}

.rn-worker-missing-block {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 3px solid var(--rn-w-warning);
}

.rn-worker-missing-block h3 {
    color: var(--rn-w-warning);
}

.rn-garment-missing li.rn-garment-row {
    background: var(--rn-w-warning-bg);
    margin: 0 -8px 6px;
    padding: 0 8px;
    border-radius: 6px;
    border-bottom: none;
}

.rn-garment-missing .rn-garment-trigger {
    padding: 10px 0;
}

.rn-worker-empty,
.rn-worker-empty-sm {
    color: #6b7280;
    margin: 8px 0;
}

.rn-worker-detail-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rn-worker-detail-toolbar h2 {
    flex: 1;
    margin: 0;
    font-size: 1.35rem;
}

.rn-worker-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rn-worker-customer {
    background: #fff;
    border: 1px solid var(--rn-w-border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.rn-worker-item-block {
    background: #fff;
    border: 2px solid var(--rn-w-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.rn-worker-item-block.has-missing {
    border-color: var(--rn-w-warning);
    background: #fffaf5;
}

.rn-worker-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.rn-worker-item-head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.rn-worker-item-body {
    display: grid;
    grid-template-columns: minmax(240px, 0.85fr) minmax(280px, 1.15fr);
    gap: 16px;
    align-items: start;
}

.rn-worker-item-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.rn-worker-item-grid p,
.rn-worker-section p,
.rn-worker-customer p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
}

.rn-worker-missing-qty {
    color: var(--rn-w-warning);
}

.rn-worker-note {
    margin-top: 12px !important;
    padding: 12px;
    background: #fef3c7;
    border-radius: 8px;
}

.rn-worker-meta {
    color: #6b7280;
    margin-top: 8px !important;
}

.rn-worker-item-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    background: #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    min-height: 120px;
}

.rn-worker-image {
    margin: 0;
    background: rgba(128,128,128,0.35);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #d1d5db;
}

.rn-worker-image.is-main {
    border-color: #f59e0b;
    grid-column: span 2;
}

.rn-worker-image img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    display: block;
    background: transparent;
}

.rn-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rn-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.rn-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100vw - 32px));
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.rn-modal-dialog h3 {
    margin: 0 0 8px;
}

.rn-modal-hint {
    margin: 0 0 16px;
    color: #6b7280;
}

.rn-modal-dialog label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.rn-modal-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 20px;
    border: 2px solid var(--rn-w-border);
    border-radius: 10px;
    box-sizing: border-box;
}

.rn-modal-error {
    color: #b91c1c;
    margin: 10px 0 0;
}

.rn-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.rn-message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
}

.rn-message.success {
    background: #dcfce7;
    color: #166534;
}

.rn-message.error,
.rn-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
}

@media (max-width: 900px) {
    .rn-worker-dashboard {
        grid-template-columns: 1fr;
    }
    
    .rn-worker-sidebar {
        border-left: none;
        border-top: 3px solid #9ca3af;
    }
    
    .rn-worker-item-body {
        grid-template-columns: 1fr;
    }
    
    .rn-worker-image.is-main {
        grid-column: span 1;
    }
}

/* Panel za zaposlene — tabovi */
.rn-employee-chrome {
    margin-bottom: 20px;
}

.rn-employee-title {
    margin: 0 0 12px;
    font-size: 1.5rem;
}

.rn-employee-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.rn-employee-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 2px solid #9ca3af;
    border-radius: 8px;
    background: #f3f4f6;
    color: #111;
    text-decoration: none;
    font-weight: 600;
}

.rn-employee-tab.is-active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.rn-employee-tab.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rn-employee-user {
    margin: 0;
    font-size: 1.1rem;
}

/* Priprema */
.rn-prep-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rn-prep-card {
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
}

.rn-prep-card.is-urgent {
    background: #f3e8ff;
    border-color: #c4b5fd;
}

.rn-prep-card-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.rn-prep-order-num {
    margin: 0 8px 0 0;
    display: inline-block;
    font-size: 1.25rem;
}

.rn-prep-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rn-prep-item {
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.rn-prep-item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.rn-prep-item + .rn-prep-item {
    margin-top: 16px;
}

.rn-prep-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.rn-prep-meta-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.rn-prep-meta-label {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.92em;
}

.rn-prep-print-name {
    font-weight: 700;
}

.rn-prep-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.rn-prep-image {
    position: relative;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
}

.rn-prep-image.is-prepared {
    border-color: #16a34a;
}

.rn-prep-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    background: #fff;
}

.rn-prep-check-on-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.rn-prep-check input {
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.rn-prep-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
