/**
 * Ticket Pro - Style Globale
 * Sistema Multi-Azienda Responsive
 */

/* ========== RESET E BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; color: #333; background: #f4f6f9; line-height: 1.5; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

/* ========== TYPOGRAPHY ========== */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
small { font-size: 0.8rem; }
.text-muted { color: #999; }
.text-primary { color: #3498db; }
.text-success { color: #27ae60; }
.text-warning { color: #f39c12; }
.text-danger { color: #e74c3c; }

/* ========== LAYOUT HELPERS ========== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; flex-wrap: wrap; }
[class*="col-"] { flex: 1; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========== CARDS ========== */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.card-header h3 { font-size: 1rem; color: #2c3e50; margin: 0; }
.card-body { padding: 0; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 0.9rem; font-family: inherit; transition: all 0.2s; background: #fff; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: auto; margin-right: 6px; }
.form-group.checkbox { display: flex; align-items: center; gap: 8px; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } }

/* ========== BUTTONS ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-outline { background: transparent; border: 2px solid #ddd; color: #666; }
.btn-outline:hover { border-color: #3498db; color: #3498db; }
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-xs { padding: 3px 7px; font-size: 0.7rem; }
.btn-block { display: flex; width: 100%; }
.btn-group { display: flex; gap: 5px; }

/* ========== BADGES ========== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3px; }
.badge-primary { background: #e8f4fd; color: #2980b9; }
.badge-info { background: #e8f4fd; color: #2980b9; }
.badge-success { background: #e8f8f0; color: #27ae60; }
.badge-warning { background: #fef5e7; color: #f39c12; }
.badge-danger { background: #fdedec; color: #e74c3c; }
.badge-secondary { background: #eaecee; color: #7f8c8d; }
.badge-dark { background: #2c3e50; color: #fff; }
.badge-light { background: #f8f9fa; color: #333; border: 1px solid #ddd; }

/* ========== ALERTS ========== */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-info { background: #e8f4fd; color: #2980b9; border: 1px solid #bee5eb; }
.alert-success { background: #e8f8f0; color: #27ae60; border: 1px solid #c3e6cb; }
.alert-warning { background: #fef5e7; color: #f39c12; border: 1px solid #ffeeba; }
.alert-danger { background: #fdedec; color: #e74c3c; border: 1px solid #f5c6cb; }

/* ========== TABLES ========== */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { background: #f8f9fa; padding: 10px 12px; text-align: left; font-size: 0.75rem; text-transform: uppercase; color: #666; font-weight: 600; white-space: nowrap; }
table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; }
table tbody tr:hover { background: #fafbfc; }
table tbody tr:nth-child(even) { background: #fafbfc; }
table tbody tr:nth-child(even):hover { background: #f0f4f8; }

/* ========== STATS ========== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; align-items: center; gap: 15px; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; flex-shrink: 0; }
.stat-icon.blue { background: #3498db; }
.stat-icon.green { background: #27ae60; }
.stat-icon.orange { background: #f39c12; }
.stat-icon.red { background: #e74c3c; }
.stat-info h4 { font-size: 1.5rem; font-weight: 700; color: #2c3e50; }
.stat-info p { font-size: 0.75rem; color: #999; text-transform: uppercase; }

/* ========== MODAL ========== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; display: none; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 25px; max-width: 600px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal h3 { margin-bottom: 15px; }
.modal .modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }

/* ========== TABS ========== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #eee; margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 20px; cursor: pointer; font-size: 0.9rem; font-weight: 500; color: #999; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all 0.2s; }
.tab:hover { color: #3498db; }
.tab.active { color: #3498db; border-bottom-color: #3498db; font-weight: 600; }

/* ========== PAGINATION ========== */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; text-decoration: none; font-size: 0.85rem; color: #3498db; border: 1px solid #ddd; transition: all 0.2s; }
.pagination a:hover { background: #e8f4fd; }
.pagination .active { background: #3498db; color: #fff; border-color: #3498db; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .container { padding: 0 10px; }
    .card { padding: 15px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    table th, table td { padding: 8px; font-size: 0.75rem; }
    .btn { font-size: 0.8rem; padding: 8px 14px; }
}