/* TechZone - Estilo orokorra */

* { box-sizing: border-box; }

html {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fb;
    color: #1e293b;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }

.edukiontzia {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Goiburua ===== */
.goiburua {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 14px 0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.goiburua-barra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.marka {
    color: #38bdf8;
    text-decoration: none;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nabigazioa {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.menu-esteka,
.erabiltzaile-kutxa {
    padding: 10px 14px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
    color: white;
    background: transparent;
}

.menu-esteka:hover,
.erabiltzaile-kutxa:hover {
    background: rgba(255,255,255,0.10);
}

.aktibo {
    background: #2563eb !important;
}

.orgatxo-kontagailua {
    background: #ef4444;
    color: white;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
    font-weight: 700;
}

/* ===== Dropdown ===== */
.dropdown {
    position: relative;
}

.erabiltzaile-kutxa {
    background: rgba(255,255,255,0.06);
    gap: 8px;
}

.avatar-kutxa {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.dropdown-menua {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    z-index: 50;
}

.dropdown.irekita .dropdown-menua {
    display: block;
}

.dropdown-menua a,
.dropdown-menua button {
    width: 100%;
    display: block;
    text-align: left;
    padding: 12px 16px;
    background: white;
    color: #0f172a;
    text-decoration: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.dropdown-menua a:hover,
.dropdown-menua button:hover {
    background: #f1f5f9;
}

.dropdown-menua form {
    margin: 0;
}

/* ===== Bilaketa barra ===== */
.bilaketa-kutxa {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 360px;
}

.bilaketa-kutxa input {
    background: transparent;
    border: none;
    color: black;
    flex: 1;
    padding: 6px;
    font-size: 14px;
    outline: none;
}

.bilaketa-kutxa input::placeholder {
    color: rgba(255,255,255,0.6);
}

.bilaketa-kutxa button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}

/* ===== Botoiak ===== */
.botoi-nagusia,
.botoi-biguna,
.botoi-arriskua,
.botoi-arrakasta {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: 0.15s ease;
}

.botoi-nagusia { background: #2563eb; color: white; }
.botoi-nagusia:hover { background: #1d4ed8; }

.botoi-biguna { background: #e2e8f0; color: #0f172a; }
.botoi-biguna:hover { background: #cbd5e1; }

.botoi-arriskua { background: #dc2626; color: white; }
.botoi-arriskua:hover { background: #b91c1c; }

.botoi-arrakasta { background: #16a34a; color: white; }
.botoi-arrakasta:hover { background: #15803d; }

.botoi-txikia {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* ===== Kutxak ===== */
.kutxa {
    background: white;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* ===== Alertak ===== */
.alerta {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
}

.alerta-errorea {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alerta-ondo {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alerta-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.ordainketa-oharra {
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
}

.ordainketa-oharra-barra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    color: #7c2d12;
    flex-wrap: wrap;
}

.ordainketa-oharra span {
    display: block;
    color: #9a3412;
    font-size: 13px;
}

/* ===== Formulario ===== */
.form-taldea {
    margin-bottom: 16px;
}

.form-taldea label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=url],
textarea,
select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== Hero ===== */
.heroia {
    background: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(30,64,175,0.88) 100%),
                radial-gradient(circle at 20% 30%, #1e3a8a 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, #312e81 0%, transparent 50%),
                #0f172a;
    color: white;
    padding: 80px 0;
    text-align: center;
}

.heroia h1 {
    font-size: 44px;
    margin: 0 0 16px 0;
    font-weight: 800;
    letter-spacing: -1px;
}

.heroia p {
    max-width: 720px;
    margin: 0 auto 24px;
    font-size: 17px;
    line-height: 1.6;
    opacity: 0.92;
}

.heroia-botoiak {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Atal ===== */
.atal {
    padding: 48px 0;
}

.atal h2 {
    font-size: 28px;
    margin: 0 0 6px 0;
    color: #0f172a;
}

.azalpena {
    color: #64748b;
    margin: 0 0 24px 0;
    font-size: 15px;
}

/* ===== Produktu txartelak ===== */
.txartel-sarea {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.produktu-txartela {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    transition: 0.2s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.produktu-txartela:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}

.produktu-txartela img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 12px;
}

.produktu-txartela h3 {
    font-size: 16px;
    margin: 0 0 6px 0;
    color: #0f172a;
    line-height: 1.3;
}

.meta {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 8px 0;
}

.prezioa {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 10px 0;
}

.prezioa-zaharra {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: line-through;
    margin-right: 8px;
    font-weight: 500;
}

.txartel-ekintzak {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 12px;
}

.txartel-ekintzak .botoi-biguna,
.txartel-ekintzak .botoi-nagusia {
    flex: 1;
    padding: 9px 12px;
    font-size: 13px;
}

.txartel-etiketa {
    display: inline-block;
    background: #fbbf24;
    color: #422006;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    margin-right: 6px;
}

.txartel-etiketa.berdea {
    background: #4ade80;
    color: #052e16;
}

.txartel-etiketa.gorria {
    background: #f87171;
    color: #450a0a;
}

/* ===== Iragazki kutxa ===== */
.iragazki-kutxa {
    background: white;
    padding: 20px;
    border-radius: 14px;
    margin: 20px 0 24px;
    box-shadow: 0 6px 16px rgba(15,23,42,0.06);
}

.iragazki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

details {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    background: #f8fafc;
}

details summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #334155;
}

.check-zerrenda {
    margin-top: 12px;
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.check-zerrenda label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.check-zerrenda input[type=checkbox] {
    width: auto;
}

/* ===== Paginazioa ===== */
.paginazioa {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 28px 0;
    flex-wrap: wrap;
}

.paginazioa a,
.paginazioa span {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.paginazioa .uneOrria {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* ===== Taula ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 13px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

th {
    background: #f1f5f9;
    font-weight: 700;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: #f8fafc;
}

/* ===== Orgatxoa ===== */
.orgatxo-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    gap: 18px;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.orgatxo-item img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
}

.laburpena {
    margin-top: 24px;
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.laburpena-erlazioa {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
}

.laburpena-erlazioa.guztira {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.ordainketa-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.ordainketa-botoia {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
}

.ordainketa-botoia:disabled {
    opacity: 0.65;
    cursor: wait;
}

.ordainketa-produktuak {
    display: grid;
    gap: 12px;
    margin: 14px 0 18px;
}

.ordainketa-produktua {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.ordainketa-produktua:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ===== Detail orria ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.detail-irudia {
    width: 100%;
    border-radius: 14px;
    background: white;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.detail-irudia img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ===== Heroia secciones admin ===== */
.admin-laburpena {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.admin-txartela {
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    border-left: 4px solid #2563eb;
}

.admin-txartela h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.admin-txartela .balioa {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
}

/* ===== Izarrak ===== */
.izarrak {
    color: #fbbf24;
    font-size: 18px;
    letter-spacing: 2px;
}

.izarrak.txikia { font-size: 14px; }

.balorazio-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 0;
}

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

.balorazio-laburra {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    margin: 4px 0 8px;
}

.pedido-progreso {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 22px 0;
}

.pedido-pausoa {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
}

.pedido-pausoa span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #cbd5e1;
    color: white;
    font-weight: 800;
    flex: 0 0 auto;
}

.pedido-pausoa.aktibo {
    border-color: #86efac;
    background: #f0fdf4;
    color: #14532d;
}

.pedido-pausoa.aktibo span {
    background: #16a34a;
}

.faktura-body {
    background: #e5e7eb;
    display: block;
    min-height: 100vh;
}

.faktura-orria {
    width: min(960px, calc(100% - 32px));
    margin: 32px auto;
    background: white;
    color: #111827;
    padding: 42px;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.faktura-goiburua,
.faktura-bezeroa {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.faktura-goiburua h1 {
    margin: 0 0 8px;
    color: #2563eb;
    font-size: 34px;
}

.faktura-goiburua p,
.faktura-bezeroa p {
    margin: 4px 0;
    color: #4b5563;
}

.faktura-meta {
    text-align: right;
    display: grid;
    gap: 6px;
}

.faktura-bezeroa h2 {
    margin: 0 0 8px;
    font-size: 15px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.faktura-taula {
    margin-top: 10px;
}

.faktura-totalak {
    margin-left: auto;
    width: min(360px, 100%);
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.faktura-totalak div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

.faktura-total-handia {
    font-size: 22px;
    color: #0f172a;
}

.faktura-oina {
    margin-top: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.faktura-ekintzak {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media print {
    .faktura-body {
        background: white;
    }

    .faktura-orria {
        width: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .faktura-ekintzak {
        display: none;
    }
}

/* ===== Footer ===== */
.oina {
    background: #0f172a;
    color: #cbd5e1;
    padding: 28px 0;
    margin-top: auto;
    text-align: center;
}

.oina p { margin: 0; font-size: 14px; }

/* ===== Erantzunkortasuna ===== */
@media (max-width: 768px) {
    .goiburua-barra { flex-direction: column; align-items: stretch; }
    .heroia { padding: 50px 0; }
    .heroia h1 { font-size: 30px; }
    .orgatxo-item { grid-template-columns: 1fr; }
    .orgatxo-item img { height: 160px; }
    .detail-grid { grid-template-columns: 1fr; }
    .ordainketa-grid { grid-template-columns: 1fr; }
    .pedido-progreso { grid-template-columns: 1fr; }
    .bilaketa-kutxa { max-width: 100%; }
}

/* Inbentarioko stock koloreak */
.stock-gorria { color: #dc2626; }
.stock-laranja { color: #d97706; }
.stock-berdea { color: #16a34a; }
