@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: hsl(358, 77%, 50%);
    --primary-dark: hsl(358, 77%, 40%);
    --primary-light: hsla(358, 77%, 50%, 0.1);
    --secondary: hsl(210, 20%, 30%);
    --success: hsl(150, 70%, 40%);
    --success-light: hsla(150, 70%, 40%, 0.1);
    --warning: hsl(35, 90%, 50%);
    --warning-light: hsla(35, 90%, 50%, 0.1);
    --danger: hsl(0, 72%, 51%);
    --danger-light: hsla(0, 72%, 51%, 0.1);
    --background: hsl(210, 20%, 98%);
    --surface: #ffffff;
    --text-main: hsl(210, 20%, 15%);
    --text-muted: hsl(210, 10%, 45%);
    --border: hsl(210, 10%, 90%);
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Common Layout */
header {
    background: hsla(0, 0%, 100%, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    gap: 8px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: hsl(0, 72%, 40%); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

/* Status Badges */
.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-pending { background: var(--warning-light); color: var(--warning); }
.status-validated { background: var(--success-light); color: var(--success); }
.status-archived { background: var(--border); color: var(--text-muted); }

/* Badges (Mezzi) */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-ambulanza { background: var(--danger-light); color: var(--danger); }
.badge-pulmino { background: hsl(200, 80%, 95%); color: hsl(200, 80%, 40%); }

/* Table Styles */
.data-table-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: hsl(210, 20%, 97%);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: hsl(210, 20%, 99%); }

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--background);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
