/* ============================
   RESET & GLOBAL
   ============================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    background: #f3f4f6;
    color: #111827;
}

/* Text general */

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

small {
    font-size: 12px;
    color: #6b7280;
}

.input,
.select{
    height:38px;
}


/* ============================
   LAYOUT: HEADER / FOOTER / CONTENT
   ============================ */

.main-header {
    background: #3388eb; /* setat de tine */
    color: #fffff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 16px;
}

.main-nav a,
.main-nav span {
    color: #e5e7eb;
    margin-left: 15px;
    font-size: 14px;
}

.main-nav a:hover {
    text-decoration: underline;
}

.main-content {
    padding: 20px;
}

.main-footer {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    margin-top: 40px;
}

/* Titluri & zone de acțiuni */

.page-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

.page-actions {
    margin-bottom: 15px;
}

/* ============================
   LOGIN
   ============================ */

.login-container {
    max-width: 400px;
    margin: 60px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.login-container h1 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
}

/* ============================
   CARDS & PANELS
   ============================ */

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.card-header {
    margin-bottom: 10px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px;
}

.card-subtitle {
    font-size: 13px;
    color: #6b7280;
}

/* ============================
   FORMS
   ============================ */

.form-group {
    margin-bottom: 15px;
}

.form-group > label:first-child {
    display: inline-block;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 600; /* puțin mai gros ca să iasă în evidență */
}

/* Input-uri text, email, numeric etc. */

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group input[type="time"] {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

/* Textarea & select */

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

/* Checkbox-uri */

.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0 6px 0 0;
    vertical-align: middle;
    border: none;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 2px;
}

/* Form actions */

.form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================
   BUTTON SYSTEM (GLOBAL)
   ============================ */

.btn {
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-align: center;
}

/* Buton primar (albastru) */
.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}
.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1e40af;
}

/* Buton secundar (gri deschis) */
.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #cbd5e1;
    color: #111827;
}

/* Buton mic (ex. în tabele, liste) */
.btn-small {
    padding: 3px 8px;
    font-size: 12px;
}

/* Buton periculos (ștergere etc.) */
.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #dc2626;
}
.btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
}

/* Link stilizat (ex. acțiuni secundare) */
.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    color: #2563eb;
}
.btn-link:hover {
    text-decoration: underline;
}

/* ============================
   ALERTS / MESSAGES
   ============================ */

.alert {
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
    border: 1px solid transparent;
}

/* Success */
.alert-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

/* Error */
.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* Info */
.alert-info {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* Warning */
.alert-warning {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fef08a;
}

/* Alias pentru ce aveai înainte: error-message */
.error-message {
    background: #fee2e2;
    color: #b91c1c;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 10px;
    border: 1px solid #fecaca;
}
/* Banner status fișă de service */
.status-box {
    border-radius: 6px;
    padding: 8px 12px;
    margin: 12px 0 16px;
    border-left: 4px solid transparent;
    font-size: 14px;
}

.status-box-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.status-box-text {
    font-size: 13px;
}

/* Culori per status */
.status-new {
    background-color: #e0f2fe;
    border-left-color: #0ea5e9;
    color: #0369a1;
}

.status-in-progress {
    background-color: #fef9c3;
    border-left-color: #facc15;
    color: #92400e;
}

.status-order,
.status-waiting {
    background-color: #fef3c7;
    border-left-color: #f97316;
    color: #b45309;
}

.status-finished {
    background-color: #dcfce7;
    border-left-color: #22c55e;
    color: #166534;
}

.status-picked {
    background-color: #e5e7eb;
    border-left-color: #6b7280;
    color: #374151;
}

.status-cancelled {
    background-color: #fee2e2;
    border-left-color: #ef4444;
    color: #b91c1b;
}

/* ============================
   BADGES / TAGS
   ============================ */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid transparent;
}

/* Exemple de culori pentru badge-uri generice */
.badge-neutral {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.badge-warning {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fef08a;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* ============================
   TABLES
   ============================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    overflow: hidden;
}

.table th,
.table td {
    padding: 8px;
    font-size: 13px;
    text-align: left;
}

.table thead tr {
    background: #f3f4f6;
}

.table tbody tr:nth-child(even) {
    background: #f9fafb;
    border-radius:5px;
}

/* Device table din client_view.php */

.device-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    overflow: hidden;
}

.device-table thead tr {
    background: #f3f4f6;
}

.device-table th,
.device-table td {
    padding: 8px;
    font-size: 13px;
}

/* Linie fină între rândurile de device-uri (în tbody) */
.device-table tbody tr + tr td {
    border-top: 1px solid #e5e7eb;
}

/* Acțiuni în tabele: butoane pe același rând */
.actions-flex {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

/* ============================
   TEXT UTILS
   ============================ */

.text-muted {
    color: #6b7280;
    font-size: 13px;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* ============================
   MISC
   ============================ */

/* Poți adăuga aici utilitare pe care le mai folosim pe parcurs */

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

/* Pille status în listă / căutare fișe */
.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid transparent;
}

/* culori compatibile cu bannerele din ticket_view */
.status-pill-new {
    background-color: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}

.status-pill-in-progress {
    background-color: #fef9c3;
    border-color: #facc15;
    color: #92400e;
}

.status-pill-order,
.status-pill-waiting {
    background-color: #fef3c7;
    border-color: #f97316;
    color: #b45309;
}

.status-pill-finished {
    background-color: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

.status-pill-picked {
    background-color: #e5e7eb;
    border-color: #6b7280;
    color: #374151;
}

.status-pill-cancelled {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #b91c1b;
}

/* Pille pentru prioritate */
.priority-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid transparent;
}

.priority-pill-normal {
    background-color: #e5e7eb;
    border-color: #d1d5db;
    color: #374151;
}

.priority-pill-urgent {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

.qr-block {
    float: right;
    margin-left: 4px;
    width: 28mm; /* mic, controlat */
}
.qr-block img {
    width: 100%;
    height: auto;
}

/* Dashboard Stoc & Reconditionare */
.grid-dashboard {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 25px;
    }

    .dash-card {
        background: #fff;
        padding: 25px;
        border-radius: 12px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.06);
        cursor: pointer;
        transition: 0.2s ease;
        border: 1px solid #e5e5e5;
        text-decoration: none !important; /* NU mai apare linia */
        color: inherit;
        text-align: center; /* Centrare text */
    }

    .dash-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    }

    .dash-card-icon {
        font-size: 45px;
        margin-bottom: 12px;
        color: #0d6efd;
    }

    .dash-card h2 {
        font-size: 20px;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .dash-card p {
        margin: 0;
        color: #666;
    }

/* ============================
   INVENTORY ITEM VIEW
   ============================ */

.item-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr);
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .item-layout {
        grid-template-columns: 1fr;
    }
}

/* Card de info produs / lot */

.item-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
}

.item-info-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.item-info-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.item-info-row:last-child {
    border-bottom: none;
}

.item-info-label {
    font-weight: 600;
    color: #4b5563;
}

.item-info-value {
    text-align: right;
    color: #111827;
    max-width: 60%;
    word-break: break-word;
}

/* Badge-uri sus, lângă titlu */

.item-meta {
    margin-top: 6px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

/* Form pe două coloane */

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px 16px;
}

.form-grid-2 .form-group {
    margin-bottom: 8px;
}

/* Card etichetă produs mai compact */

.item-label-card p {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 13px;
    color: #4b5563;
}

.item-label-card .btn {
    width: 100%;
}

/* Optional: card formular să pară mai important */
.item-form-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
}
/* Iconuri la etichetele din lista de info */
.item-info-label i {
    margin-right: 6px;
    font-size: 14px;
    color: #9ca3af;
}

/* Coloana dreaptă - formular sticky */
.item-column-right .item-form-card {
    position: sticky;
    top: 10px;
    z-index: 1;
}
/* ============================
   INVENTORY ITEM TIMELINE
   ============================ */

.item-timeline-card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.item-timeline {
    margin-top: 8px;
    border-left: 2px solid #e5e7eb;
    padding-left: 14px;
}

.timeline-entry {
    position: relative;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 13px;
}

.timeline-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-entry::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background-color: #2563eb;
    box-shadow: 0 0 0 3px #dbeafe;
}

.timeline-entry-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.timeline-entry-user {
    font-weight: 600;
    color: #111827;
}

.timeline-entry-meta {
    font-size: 12px;
    color: #6b7280;
}

.timeline-entry-notes {
    margin-top: 3px;
    color: #374151;
}

.timeline-entry-details {
    margin-top: 4px;
}

.timeline-entry-details summary {
    cursor: pointer;
    font-size: 12px;
    color: #2563eb;
}

.timeline-entry-changes {
    margin: 4px 0 0;
    padding-left: 10px;
}

.timeline-entry-changes li {
    font-size: 12px;
    color: #4b5563;
}

.current-ticket-row {
        background-color: #e7f5ff;
    }

