/* ================================
   MAGAZZINO PREMIUM – CD AUTOTRASPORTI
   Stile unificato per Eventi + NC
   Ottimizzato per smartphone
=================================== */

:root {
    --bg-dark: #0f172a;
    --bg-light: #ffffff;
    --bg-soft: #f9fafb;

    --text-main: #111827;
    --text-soft: #6b7280;

    --border-soft: #e5e7eb;
    --primary: #1d4ed8;
    --primary-dark: #0f172a;

    --radius: 14px;
}

/* Reset */

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-soft);
    color: var(--text-main);
}

/* Top bar */

.topbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    padding: 10px 14px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    height: 38px;
    width: auto;
    border-radius: 4px;
}

.brand-text .brand-name {
    font-size: 15px;
    font-weight: 700;
}

.brand-text .brand-module {
    font-size: 12px;
    opacity: 0.85;
}

/* Audit badge */

.audit-badge {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.audit-badge .badge-main {
    font-size: 12px;
    font-weight: 500;
}

.audit-badge .badge-sub {
    font-size: 11px;
    opacity: .85;
}

/* Info banner */

.info-banner {
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    font-size: 13px;
}

/* Panels */

.layout {
    display: flex;
    justify-content: center;
    padding: 20px 12px;
}

.panel {
    width: 100%;
    max-width: 1000px;
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--border-soft);
}

.panel-header h2 {
    margin: 0;
    font-size: 17px;
}

.panel-header .panel-sub {
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 12px;
}

/* Form grid */

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

.field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    background: var(--bg-soft);
    font-size: 13px;
}

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

.field-full {
    grid-column: 1 / -1;
}

/* Buttons */

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--border-soft);
    background: white;
    color: var(--text-main);
}

.btn-primary {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Messages */

.messages .ok {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: #065f46;
    font-size: 13px;
}

/* Footer */

.app-footer {
    text-align: center;
    padding: 14px;
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 20px;
}

/* Badges */

.badge {
    padding: 3px 10px;
    border-radius: 999px;
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
}

.badge-stato-aperto {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-stato-lavorazione {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-stato-chiuso {
    background: #ecfdf5;
    color: #166534;
}

.badge-prio-alta {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-prio-media {
    background: #fef3c7;
    color: #92400e;
}

.badge-prio-bassa {
    background: #dcfce7;
    color: #166534;
}

/* Image preview */

.photo-preview img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
}

/* Mobile */

@media (max-width: 680px) {
    .brand-module {
        font-size: 11px !important;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .audit-badge {
        text-align: left;
    }
}
