/* OMR - Main CSS */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: var(--gray-900);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 20px;
}

.navbar-menu {
    display: flex;
    gap: 20px;
}

.navbar-menu a {
    color: var(--gray-300);
    text-decoration: none;
}

.navbar-menu a:hover {
    color: white;
}

.navbar-user {
    margin-left: auto;
    color: var(--gray-300);
}

/* Main content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Alerts */
.messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Page headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 28px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card.stat-highlight {
    background: var(--primary);
    color: white;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 5px;
}

.stat-highlight .stat-label {
    color: rgba(255,255,255,0.8);
}

/* Tables */
.data-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-collapse: collapse;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--gray-500);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: var(--gray-50);
}

.text-center {
    text-align: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-lg {
    padding: 8px 16px;
    font-size: 14px;
}

.badge-bozza {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-aperta {
    background: #dbeafe;
    color: #1e40af;
}

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

.badge-in_controllo {
    background: #fed7aa;
    color: #c2410c;
}

.badge-conclusa {
    background: #d1fae5;
    color: #065f46;
}

.badge-annullata {
    background: #fee2e2;
    color: #991b1b;
}

.badge-da_fare {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-completato {
    background: #d1fae5;
    color: #065f46;
}

/* Progress bars */
.progress-mini {
    width: 80px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 3px;
}

.progress-text {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 8px;
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.detail-card h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-table {
    width: 100%;
}

.detail-table th {
    text-align: left;
    font-weight: 500;
    color: var(--gray-500);
    padding: 8px 0;
    width: 40%;
}

.detail-table td {
    padding: 8px 0;
}

/* Actions */
.actions-row {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.actions-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Filters */
.filters {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-form input,
.filter-form select {
    padding: 10px 15px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* File list */
.file-list {
    list-style: none;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.file-list li {
    padding: 10px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list a {
    color: var(--primary);
    text-decoration: none;
}

.file-list .file-type {
    margin-left: auto;
    font-size: 12px;
    color: var(--gray-500);
}

/* Note box */
.note-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--gray-500);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-wrap: wrap;
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        padding-top: 15px;
    }
    
    .filter-form {
        flex-wrap: wrap;
    }
}
