/* PDF Tracker — Stili admin */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    padding: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* Header */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ddd;
}

header h1 {
    font-size: 1.4rem;
}

.btn-logout {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-logout:hover {
    color: #c00;
}

/* Login */

.login-container {
    max-width: 360px;
    margin: 8rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.login-container label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #555;
}

.login-container input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.login-container button {
    width: 100%;
    padding: 0.7rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.login-container button:hover {
    background: #1d4ed8;
}

.error {
    color: #c00;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* Filtri */

.filters {
    background: #fff;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.filters form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.filters label {
    font-size: 0.85rem;
    color: #555;
}

.filters select,
.filters input[type="date"] {
    padding: 0.4rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filters button {
    padding: 0.4rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.filters button:hover {
    background: #1d4ed8;
}

.btn-reset {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-export {
    padding: 0.4rem 1rem;
    background: #16a34a;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-export:hover {
    background: #15803d;
}

/* KPI */

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: #fff;
    padding: 1.2rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.kpi-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: #2563eb;
}

.kpi-label {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.3rem;
}

/* Cards e grafici */

.card {
    background: #fff;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2,
.recent h2 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #555;
}

.chart-wrap {
    position: relative;
    height: 180px;
}

.chart-wrap-sm {
    position: relative;
    height: 150px;
}

.charts-row-single {
    margin-bottom: 1rem;
}

.charts-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.recent {
    background: #fff;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 2px solid #eee;
    color: #777;
    font-weight: 600;
}

tbody td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
    background: #fafafa;
}

/* Responsive */

@media (max-width: 700px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
    .charts-row-half {
        grid-template-columns: 1fr;
    }
}
