/* =====================================================
   BRUTALAN MODERAN DASHBOARD - FULL RESPONSIVE FIX
   ===================================================== */

/* ==================== CSS VARIJABLE ==================== */
:root {
    /* Glavne boje - Tamno plava/crna paleta */
    --bg-primary: #0a0e1a;
    --bg-secondary: #131b2e;
    --bg-tertiary: #1a2332;
    --bg-card: #1e2738;
    
    /* Tekst */
    --text-primary: #e8edf4;
    --text-secondary: #a1abb8;
    --text-muted: #6b7785;
    
    /* Accent boje */
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    
    /* Status boje */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    /* Granice i senke */
    --border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    
    /* Blur efekti */
    --blur-sm: blur(8px);
    --blur-md: blur(12px);
}

.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ==================== RESET & RESPONSIVE BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* KRITIČNO ZA MOBITEL: sprečava horizontal scroll */
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
    /* KRITIČNO: sprečava horizontal scroll */
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    line-height: 1.6;
    position: relative;
}

/* ==================== TOP NAVIGACIJA ==================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(19, 27, 46, 0.95);
    backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    /* KRITIČNO: fiksna širina */
    width: 100%;
    max-width: 100vw;
}

.light-theme .top-nav {
    background: rgba(255, 255, 255, 0.95);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* Sprečava overflow */
    flex-shrink: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.logo:hover {
    transform: scale(1.05);
}

/* Hamburger Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10000;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: 10px;
}

.nav-item:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-item:hover::before {
    opacity: 0.1;
}

.nav-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1) rotate(5deg);
}

.nav-label {
    white-space: nowrap;
}

/* Nav Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* Sprečava overflow */
    flex-shrink: 0;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-blue);
}

.logout-btn {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ==================== RESPONSIVE MENU ==================== */
@media (max-width: 968px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1.5rem;
        gap: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--border);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        /* KRITIČNO: sprečava širenje */
        width: 100%;
        max-width: 100vw;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.25rem;
    }
    
    .nav-label {
        flex: 1;
    }
}

/* ==================== MAIN CONTENT ==================== */
.main-wrapper {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
    /* KRITIČNO: sprečava overflow */
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
    /* KRITIČNO: sprečava overflow */
    width: 100%;
    overflow-x: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== TYPOGRAPHY ==================== */
h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    animation: slideIn 0.6s ease;
    /* RESPONSIVE: ne prelazi širinu */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 1.25rem;
    color: var(--text-primary);
    word-wrap: break-word;
}

h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: var(--text-secondary);
    word-wrap: break-word;
}

/* ==================== FORMS ==================== */
form {
    margin: 1.5rem 0;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    /* KRITIČNO: sprečava overflow */
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: var(--bg-secondary);
}

input:hover,
select:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

button[type="submit"],
.btn-filter {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before,
.btn-filter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[type="submit"]:hover::before,
.btn-filter:hover::before {
    width: 300px;
    height: 300px;
}

button[type="submit"]:hover,
.btn-filter:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

button[type="submit"]:active,
.btn-filter:active {
    transform: translateY(-1px);
}

/* Date Filter Container */
.date-filter {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.date-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.date-filter-row .btn-filter {
    width: auto;
    padding: 0.875rem 2rem;
    white-space: nowrap;
}

/* ==================== TABLES - FULL RESPONSIVE ==================== */
.table-wrapper {
    /* KRITIČNO: wrapper za scroll */
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--bg-tertiary);
}

.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

.table {
    width: 100%;
    min-width: 600px; /* KRITIČNO: minimalna širina za čitljivost */
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
    transform: scale(1.005);
    box-shadow: var(--shadow-sm);
}

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

/* Cell Scroll - za JAKO duge stringove (API keys) */
.cell-scroll {
    max-width: 300px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--bg-tertiary);
}

.cell-scroll::-webkit-scrollbar {
    height: 6px;
}

.cell-scroll::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.cell-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 3px;
}

/* ==================== STATUS BADGES ==================== */
.positive,
.negative,
.neutral {
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.positive {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success);
}

.negative {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.neutral {
    background: rgba(107, 119, 133, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

/* ==================== BUTTONS ==================== */
.delete-btn {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    border: none;
    padding: 0.625rem 1.125rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.delete-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.stop-bot {
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.stop-bot:hover {
    transform: scale(1.3) rotate(-10deg);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
}

/* ==================== LINKS ==================== */
a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    word-wrap: break-word;
}

a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
    color: var(--accent-purple);
}

/* ==================== MESSAGES ==================== */
.message {
    padding: 1.125rem;
    border-radius: 12px;
    margin: 1.25rem 0;
    text-align: center;
    font-weight: 600;
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid var(--danger);
    animation: shake 0.5s ease;
    word-wrap: break-word;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==================== CHARTS ==================== */
.chart-container {
    position: relative;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    /* KRITIČNO: responsive chart */
    width: 100%;
    overflow: hidden;
}

.chart-container:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

.chart-container canvas {
    max-height: 300px !important;
    width: 100% !important;
    height: auto !important;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
}

/* Chart Zoom Modal - FULLSCREEN */
.chart-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: var(--blur-md);
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chart-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-modal-content {
    position: relative;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 95vw;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.chart-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
}

.chart-modal-close:hover {
    transform: rotate(90deg) scale(1.2);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.chart-modal-content canvas {
    max-height: 75vh !important;
    width: 100% !important;
    height: auto !important;
}

/* ==================== MONITORING STYLES ==================== */
.exchange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
}

.exchange-card {
    padding: 1.75rem;
    background: var(--bg-tertiary);
    border-radius: 16px;
    border: 2px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.exchange-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.exchange-card:hover::before {
    transform: scaleX(1);
}

.exchange-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-blue);
}

.ex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-pill {
    padding: 0.625rem 1.25rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.875rem;
    animation: glow 2s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor;
    }
}

.status-on {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success);
}

.status-off {
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn {
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.95rem;
}

.btn-on {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-on:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-off {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-off:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.metrics-table th,
.metrics-table td {
    padding: 0.875rem 1.125rem;
}

.tag {
    font-weight: 800;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    white-space: nowrap;
}

.tag-red {
    color: var(--danger);
    background: var(--danger-bg);
}

.tag-yellow {
    color: var(--warning);
    background: var(--warning-bg);
}

.tag-green {
    color: var(--success);
    background: var(--success-bg);
}

.small {
    font-size: 0.85rem;
    opacity: 0.75;
}

.section {
    margin-top: 3rem;
    animation: fadeInUp 0.6s ease;
    width: 100%;
    overflow-x: hidden;
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    max-width: 440px;
    margin: 4rem auto;
}

/* ==================== PROFIT DISPLAY ==================== */
.profit-cell {
    text-align: center;
}

.profit-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
}

.profit-number {
    font-size: 1.25rem;
    font-weight: 800;
}

.position-info {
    font-size: 0.8rem;
    opacity: 0.7;
    color: var(--text-muted);
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 0.75rem;
    }
    
    .main-wrapper {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        padding-top: 70px;
    }
    
    .container {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chart-container {
        padding: 1.25rem;
    }
    
    .chart-container canvas {
        max-height: 250px !important;
    }
    
    .exchange-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
        min-width: 500px;
    }
    
    .table th,
    .table td {
        padding: 0.875rem 0.625rem;
    }
    
    .date-filter-row {
        grid-template-columns: 1fr;
    }
    
    .date-filter-row .btn-filter {
        width: 100%;
    }
    
    .nav-right {
        gap: 0.5rem;
    }
    
    .logout-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .top-nav {
        height: 56px;
        padding: 0 0.5rem;
    }
    
    .logo {
        font-size: 1.125rem;
    }
    
    .logo span:last-child {
        display: none; /* Sakrij "Dashboard" text na malim ekranima */
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="date"],
    select {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .chart-modal-content {
        padding: 1rem;
    }
    
    .table {
        min-width: 400px;
        font-size: 0.8rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* ==================== SCROLLBAR STYLING ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--bg-tertiary);
}

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.max-w-full { max-width: 100%; }

/* KRITIČNO: Sprečava bilo koji element da pređe širinu ekrana */
* {
    max-width: 100%;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}