/**
 * ================================================
 * ZUGER KANTONALBANK - COMPLETE BANKING UI 2025
 * Белый + #0041a3 с полным набором переменных
 * ================================================
 */

/* ================================================
   ПОЛНЫЙ НАБОР CSS VARIABLES
   ================================================ */
:root {
    /* Основная палитра */
    --primary: #0041a3;
    --primary-hover: #003082;
    --primary-light: #e6f2ff;
    --primary-dark: #002461;
    
    /* Базовые цвета */
    --white: #ffffff;
    --black: #000000;
    
    /* Контрастные серые */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* Семантические цвета */
    --success: #16a34a;
    --warning: #ea580c;
    --error: #dc2626;
    
    /* Текст */
    --text: var(--black);
    --text-primary: var(--black);
    --text-secondary: var(--gray-700);
    --text-muted: var(--gray-500);
    --text-inverse: var(--white);
    
    /* Фоны */
    --bg-body: var(--white);
    --bg-surface: var(--white);
    --bg-card: var(--white);
    --bg-muted: var(--gray-50);
    --bg-elevated: var(--white);
    --bg-overlay: rgba(0, 0, 0, 0.6);
    
    /* Градиенты */
    --gradient-bg: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    
    /* Границы и тени */
    --border: var(--gray-300);
    --border-light: var(--gray-200);
    --border-focus: var(--primary);
    
    /* Тени */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.08);
    --shadow-card: var(--shadow-md);
    --shadow-floating: 0 8px 32px rgba(0, 65, 163, 0.15);
    
    /* Радиусы */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
    
    /* Переходы */
    --transition: all 0.2s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.3s ease;
    
    /* Размеры */
    --sidebar-width: 280px;
    --header-height: 68px;
    --mobile-header: 56px;
    
    /* Отступы */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Z-layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal: 1050;
    --z-tooltip: 1070;
}

/* ================================================
   BASE STYLES
   ================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    overflow-x: hidden;
}

/* ================================================
   LAYOUT SYSTEM
   ================================================ */
.app {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 2px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: var(--z-sticky);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
    background: var(--bg-muted);
}

.header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-sm);
}

.main {
    flex: 1;
    padding: var(--space-8);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ================================================
   SIDEBAR С СИНИМ АКЦЕНТОМ
   ================================================ */
.sidebar-header {
    padding: var(--space-8) var(--space-6);
    text-align: center;
    border-bottom: 2px solid var(--border-light);
    background: var(--bg-surface);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 20px;
    transition: var(--transition);
}

.sidebar-logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

/* ================================================
   НАВИГАЦИЯ
   ================================================ */
.nav {
    padding: var(--space-4) 0;
}

.nav-section {
    margin: var(--space-6) 0;
    padding: 0 var(--space-4);
}

.nav-title {
    padding: 0 var(--space-3) var(--space-3);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: var(--space-3);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: var(--space-4) var(--space-3);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: var(--space-2);
    font-weight: 500;
    font-size: 15px;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.nav-item i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-3);
    font-size: 18px;
    flex-shrink: 0;
}

.nav-badge {
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    padding: var(--space-1) var(--space-2);
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* ================================================
   КАРТОЧКИ
   ================================================ */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-light);
    transition: var(--transition);
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}

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

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: var(--space-1);
    font-weight: 500;
}

/* ================================================
   КНОПКИ
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-muted);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* Размеры кнопок */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 13px;
}

.btn-lg {
    padding: var(--space-5) var(--space-8);
    font-size: 17px;
}

/* ================================================
   ФОРМЫ
   ================================================ */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 65, 163, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ================================================
   АЛЕРТЫ
   ================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    border: 2px solid;
    font-size: 15px;
    font-weight: 500;
}

.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(234, 88, 12, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-info {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ================================================
   АНИМАЦИИ
   ================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.slide-in {
    animation: slideIn 0.6s ease-out forwards;
    opacity: 0;
}

/* ================================================
   УТИЛИТЫ
   ================================================ */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.bg-primary { background: var(--primary); }
.bg-surface { background: var(--bg-surface); }
.bg-muted { background: var(--bg-muted); }

.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border { border: 2px solid var(--border); }
.border-light { border: 1px solid var(--border-light); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }

/* ================================================
   СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ БАНКОВСКИХ КАРТОЧЕК
   ================================================ */
.accounts-container {
    min-height: 100vh;
    background: var(--gradient-bg);
    display: flex;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-6);
    min-height: 100vh;
}

.page-header {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.account-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-floating);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.account-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 65, 163, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

/* ================================================
   РЕСПОНСИВ
   ================================================ */
@media (max-width: 1200px) {
    .account-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --header-height: var(--mobile-header);
    }
    
    .sidebar {
        transform: translateX(-100%);
        z-index: var(--z-modal);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-4);
    }
    
    .main {
        padding: var(--space-4);
    }
    
    .header {
        padding: 0 var(--space-4);
        height: var(--mobile-header);
    }
    
    .accounts-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }
    
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr; }
    
    .card {
        padding: var(--space-4);
    }
}

@media (max-width: 480px) {
    .main {
        padding: var(--space-3);
    }
    
    .card {
        padding: var(--space-3);
    }
}

/* ================================================
   СКРОЛЛБАРЫ
   ================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full);
}

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

/* ================================================
   ПРИНТ
   ================================================ */
@media print {
    .sidebar,
    .header,
    .btn {
        display: none !important;
    }
    
    .content {
        margin-left: 0 !important;
    }
    
    .main {
        padding: 0 !important;
        max-width: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid var(--border) !important;
    }
}