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

:root {
    --primary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --secondary: #6b7280;
    --dark: #1f2937;
    --light: #f3f4f6;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: var(--secondary);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 30px;
}

/* Navbar */
.navbar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand h2 {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary);
}

.badge-nav {
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 5px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main content */
.main-content {
    padding: 2rem;
}

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

h1 {
    margin-bottom: 2rem;
    color: var(--dark);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control, input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

textarea {
    resize: vertical;
    font-family: inherit;
}

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

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

.btn-primary:hover {
    background: #2563eb;
}

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card.pending {
    border-left: 4px solid var(--warning);
}

.stat-card.approved {
    border-left: 4px solid var(--success);
}

.stat-card.sent {
    border-left: 4px solid var(--primary);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    color: var(--dark);
    margin: 0;
}

.stat-content p {
    color: var(--secondary);
    margin: 0;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
}

.table td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

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

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.avatar, .avatar-sm {
    border-radius: 50%;
    object-fit: cover;
}

.avatar {
    width: 40px;
    height: 40px;
}

.avatar-sm {
    width: 30px;
    height: 30px;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

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

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

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

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

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

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

.badge-rating-one, .badge-rating-two {
    background: #fee2e2;
    color: #991b1b;
}

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

.badge-rating-four, .badge-rating-five {
    background: #d1fae5;
    color: #065f46;
}

/* Approval Grid */
.approval-grid {
    display: grid;
    gap: 1.5rem;
}

.approval-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.reviewer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.review-text {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 6px;
}

.review-text p {
    margin-top: 0.5rem;
    color: var(--secondary);
}

.generated-reply {
    margin-bottom: 1rem;
}

.generated-reply strong {
    display: block;
    margin-bottom: 0.5rem;
}

.reply-editor {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.approval-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.reply-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.reply-meta small {
    color: var(--secondary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

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

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* DODATO - omogućava scroll */
    background-color: rgba(0, 0, 0, 0.4);
    padding: 20px; /* DODATO - padding oko modala */
}

.modal-content {
    background-color: #fff;
    margin: 20px auto; /* PROMENJENA sa auto na 20px auto */
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 90vh; /* DODATO - maksimalna visina */
    overflow-y: auto; /* DODATO - vertikalni scroll */
}

.modal-large {
    max-width: 800px;
    max-height: 90vh; /* DODATO */
    overflow-y: auto; /* DODATO */
}

.modal-body {
    max-height: calc(90vh - 200px); /* DODATO - visina bez headera i footera */
    overflow-y: auto;
    padding-right: 10px; /* DODATO - prostor za scrollbar */
}

/* Modal actions footer - sticky na dnu */
.modal-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 1rem 0 0 0;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.close {
    position: sticky; /* PROMENJENA sa absolute na sticky */
    top: 0;
    right: 0;
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: white; /* DODATO - beli background */
    padding: 0 10px;
    float: right;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.text-muted {
    color: var(--secondary);
    font-size: 0.875rem;
}

pre {
    background: var(--light);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.875rem;
}

.badge {
	white-space: nowrap;
}