/* =====================================================
   GESTIONALE NEGOZIO - STYLESHEET PRINCIPALE
   ===================================================== */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* =====================================================
   HEADER
   ===================================================== */

.header {
    background: var(--white);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: var(--dark);
    font-size: 28px;
    font-weight: 600;
}

.header .date {
    color: var(--gray);
    font-size: 14px;
    margin-top: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

.nav-menu {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

/* =====================================================
   STATS CARDS
   ===================================================== */

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

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.stat-card .icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
}

.stat-card.sales .icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card.repairs .icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-card.customers .icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-card.expenses .icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card h3 {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    color: var(--dark);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card .change {
    font-size: 13px;
    font-weight: 500;
}

.stat-card .change.positive {
    color: var(--success);
}

.stat-card .change.negative {
    color: var(--danger);
}

/* =====================================================
   CARDS & CONTENT
   ===================================================== */

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 25px;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.card-header h2 {
    color: var(--dark);
    font-size: 20px;
    font-weight: 600;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

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

.btn-success:hover {
    background: #059669;
}

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

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

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

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* =====================================================
   FORMS
   ===================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--dark);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

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

/* =====================================================
   TABLES
   ===================================================== */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light-gray);
}

table th {
    padding: 12px 15px;
    text-align: left;
    color: var(--dark);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--light-gray);
    color: var(--dark);
    font-size: 14px;
}

table tbody tr:hover {
    background: #f9fafb;
}

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

/* =====================================================
   BADGES & LABELS
   ===================================================== */

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

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

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

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

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

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

/* =====================================================
   ACTIVITY LIST
   ===================================================== */

.activity-list {
    list-style: none;
}

.activity-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--light-gray);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-icon.sale {
    background: #d1fae5;
    color: var(--success);
}

.activity-icon.repair {
    background: #fef3c7;
    color: var(--warning);
}

.activity-icon.customer {
    background: #dbeafe;
    color: var(--primary);
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-content p {
    color: var(--gray);
    font-size: 13px;
}

.activity-time {
    color: var(--gray);
    font-size: 12px;
    white-space: nowrap;
}

/* =====================================================
   QUICK ACTIONS
   ===================================================== */

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.quick-action {
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--light-gray);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
    text-decoration: none;
    color: var(--dark);
}

.quick-action:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: scale(1.05);
}

.quick-action .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.quick-action span {
    display: block;
    font-weight: 500;
    font-size: 14px;
}

/* =====================================================
   MODAL / POPUP
   ===================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-gray);
}

.modal-header h3 {
    color: var(--dark);
    font-size: 22px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-close:hover {
    color: var(--dark);
}

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary);
}

/* =====================================================
   SEARCH & FILTERS
   ===================================================== */

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
    font-size: 28px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .nav-menu ul {
        flex-direction: column;
    }

    .nav-menu li a {
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   UTILITIES
   ===================================================== */

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

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}
