/* BORSAWEB Client Manager - Main Stylesheet */

:root {
    --bg: #0b1120;
    --card: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    --muted: rgba(255,255,255,0.6);
    --text: #e6eef8;
    --accent: #1f6feb;
    --accent-2: #184ea8;
    --good: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;
    --input-bg: rgba(255,255,255,0.03);
    --shadow: 0 8px 30px rgba(3,7,18,0.7);
    --radius: 12px;
    --success: #10b981;
    --info: #3b82f6;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

html, body { 
    height: 100%; 
    margin: 0; 
    font-family: "Segoe UI", Tahoma, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    padding: 20px;
    font-size: 14px;
    line-height: 1.5;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    border: 1px solid rgba(255,255,255,0.03);
    backdrop-filter: blur(6px);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-left .subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px;
    font-weight: 400;
}

/* Client Selector */
.client-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 300px;
}

.client-selector select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    background: var(--input-bg);
    color: var(--text);
    min-width: 250px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-selector select:hover {
    border-color: rgba(255,255,255,0.1);
}

.client-selector select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Buttons */
button {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    color: var(--text);
    background: transparent;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

button:hover { 
    opacity: 0.9; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

button:active { 
    transform: translateY(0); 
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.3);
}

button.primary { 
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); 
    color: #fff; 
}

button.secondary { 
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); 
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.05);
}

button.dangerBtn { 
    background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(220,38,38,0.9)); 
    color: #fff; 
}

button.successBtn { 
    background: linear-gradient(135deg, rgba(16,185,129,0.9), rgba(5,150,105,0.9)); 
    color: #fff; 
}

/* Sections */
.section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.section:last-child { 
    border-bottom: none; 
}

.section h2 {
    font-size: 16px;
    margin: 0 0 20px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

/* Form Elements */
label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    background: var(--input-bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(31,111,235,0.6);
    box-shadow: 0 6px 20px rgba(31,111,235,0.15);
    transform: translateY(-2px);
}

input::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.3);
}

textarea { 
    min-height: 100px; 
    resize: vertical; 
    line-height: 1.5;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.06);
    min-width: 120px;
    text-align: center;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.good { 
    background: linear-gradient(135deg, var(--good), #06b07c); 
    box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}

.badge.warn { 
    background: linear-gradient(135deg, #f59e0b, #f2b04b); 
    box-shadow: 0 4px 12px rgba(245,158,11,0.2);
}

.badge.danger { 
    background: linear-gradient(135deg, #ef4444, #e04646); 
    box-shadow: 0 4px 12px rgba(239,68,68,0.2);
}

/* Notifications */
.notification {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification.success {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    color: #10b981;
}

.notification.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
}

.notification.info {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.3);
    color: #3b82f6;
}

/* Statistics Cards */
.client-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0 30px 0;
}

.stat-card {
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.stat-card h3 {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    margin: 10px 0 0 0;
    color: var(--text);
    line-height: 1;
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group { 
    flex: 1; 
    min-width: 200px;
}

/* Required field indicator */
.required::after {
    content: " *";
    color: var(--danger);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .grid { 
        grid-template-columns: 1fr; 
    }
    
    .header { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .client-selector { 
        flex-direction: column; 
    }
    
    .client-selector select { 
        min-width: 100%; 
    }
    
    .actions { 
        justify-content: stretch; 
    }
    
    button {
        flex: 1;
        min-width: 120px;
    }
    
    .client-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .client-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card .value {
        font-size: 24px;
    }
    
    button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .section h2 {
        font-size: 15px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
        background: white;
    }
    
    button, .actions, .notification {
        display: none !important;
    }
    
    .badge {
        background: #f0f0f0 !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* Utility Classes */
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warn); }
.text-info { color: var(--info); }

.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; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }