/* RESET & ОСНОВНО */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* LOGIN PAGE */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* LAYOUT */
body:not(.login-page) {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1e3a8a;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left: 3px solid #60a5fa;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    background: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-title {
    font-size: 20px;
    color: #1e3a8a;
}

.user-info {
    color: #666;
    font-size: 14px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

/* TYPOGRAPHY */
.page-title {
    font-size: 32px;
    color: #1e3a8a;
    margin-bottom: 25px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* ФОРМИ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.inline-date {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* КОПЧИЊА */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* КАРТИЧКИ */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.mb-4 {
    margin-bottom: 25px;
}

/* СТАТИСТИКИ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.stat-icon {
    font-size: 40px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
}

/* ЕКИПИ GRID */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.team-card {
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.team-card:hover {
    border-color: #667eea;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.team-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.team-vehicle {
    font-size: 14px;
    color: #666;
}

/* ПРОТОКОЛ ЛИСТА */
.protocol-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.protocol-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.3s;
}

.protocol-item:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.protocol-team {
    font-weight: 600;
    color: #333;
}

.protocol-date {
    font-size: 14px;
    color: #666;
}

/* ПРОТОКОЛ ДОКУМЕНТ */
.protocol-document {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    font-family: Arial, sans-serif;
}

.header {
    text-align: center;
    line-height: 1.4;
    margin-bottom: 20px;
}

.title {
    font-weight: bold;
    font-size: 16px;
}

.company {
    margin-top: 10px;
}

.info {
    margin: 15px 0;
    width: 100%;
}

.info td {
    padding: 5px;
}

table.parts {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table.parts th, table.parts td {
    border: 1px solid #000;
    padding: 6px;
    text-align: center;
}

table.parts th:first-child,
table.parts td:first-child {
    text-align: left;
}

.signatures {
    margin-top: 40px;
    width: 100%;
}

.signatures td {
    width: 50%;
    text-align: center;
    padding-top: 50px;
}

.protocol-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.protocol-logo {
    width: 100px;
    height: 100px;
    background: #1e3a8a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    border-radius: 8px;
    flex-shrink: 0;
}

.protocol-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.protocol-title {
    flex: 1;
}

.protocol-title h2 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.protocol-subtitle {
    text-align: center;
    margin: 5px 0 15px 0;
    font-size: 14px;
}

.protocol-company {
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
}

.protocol-info {
    margin-bottom: 20px;
    font-size: 16px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
}

.float-right {
    float: right;
}

.protocol-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border: 2px solid #333;
}

.protocol-table th,
.protocol-table td {
    border: 1px solid #333;
    padding: 2px 4px;
    text-align: left;
    page-break-inside: avoid;
    height: 18px;
    font-size: 12px;
}

.protocol-table th {
    background: #f3f4f6;
    font-weight: bold;
    text-align: center;
}

.protocol-table td {
    min-height: 18px;
}

.text-center {
    text-align: center;
}

.table-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 4px;
    font-size: 12px;
    text-align: inherit;
}

.table-input:focus {
    outline: none;
    background: #f9fafb;
}

.protocol-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    align-items: flex-start;
}

.signature-box {
    width: 45%;
}

.signature-box p {
    margin-bottom: 10px;
    font-weight: 500;
}

.signature-line {
    border-bottom: 2px solid #333;
    padding-top: 50px;
}

/* INPUT MODES */
.input-mode {
    display: none;
}

.input-mode.active {
    display: block;
}

.mode-btn.active {
    background: #667eea !important;
    color: white !important;
}

/* FLEX UTILITIES */
.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mt-3 {
    margin-top: 15px;
}

/* ДЕЛОВИ */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.3s;
}

.part-item:hover {
    background: #f9fafb;
    border-color: #667eea;
}

/* ЕКИПИ ЛИСТА */
.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.team-item:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.team-actions {
    display: flex;
    gap: 10px;
}

.text-muted {
    color: #666;
    font-size: 14px;
}

/* DATA TABLE */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* ФИЛТРИ */
.filters-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters-form .form-control {
    flex: 1;
    min-width: 200px;
}

.search-form {
    display: flex;
    gap: 10px;
}

/* MODAL */
.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;
    padding: 0;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-content form {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* ALERTS */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* PRINT STYLES */
@media print {
    body {
        background: white;
    }
    
    .sidebar,
    .top-header,
    .no-print,
    .page-header,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .content-area {
        padding: 0;
    }
    
    .protocol-document {
        max-width: 100%;
        padding: 20px;
        box-shadow: none;
    }
    
    .protocol-table th,
    .protocol-table td {
        padding: 2px 4px;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .protocol-header {
        flex-direction: column;
    }
    
    .protocol-signatures {
        flex-direction: column;
        gap: 40px;
    }
    
    .signature-box {
        width: 100%;
    }
}

/* КРАЈ НА CSS *//*
 * Изработено од bin.mk
