/* ============================================
   EDITOR PLAN DE PAZĂ - DESIGN MODERN 2024
   Glassmorphism + Neumorphism Soft UI
   ============================================ */

/* Reset & Modern Variables */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paletă sofisticată - Blue Indigo + Amber accents */
    --primary-950: #172554;
    --primary-900: #1e3a8a;
    --primary-800: #1e40af;
    --primary-700: #1d4ed8;
    --primary-600: #2563eb;
    --primary-500: #3b82f6;
    --primary-400: #60a5fa;
    --primary-300: #93c5fd;
    --primary-200: #bfdbfe;
    --primary-100: #dbeafe;
    --primary-50: #eff6ff;

    --accent-600: #d97706;
    --accent-500: #f59e0b;
    --accent-400: #fbbf24;
    --accent-100: #fef3c7;
    --accent-50: #fffbeb;

    /* Slate modern pentru text */
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;

    /* Semantic colors - mai soft */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #047857;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #b91c1c;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --word-blue: #1e3a8a;

    /* Glassmorphism vars */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* Spacing scale modern */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Radius modern - mai pronunțat */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;

    /* Shadows elevation system */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    
    /* Transitions smooth */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font stack modern */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dark mode support - optional, dar modern */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(15, 23, 42, 0.85);
        --glass-border: rgba(255, 255, 255, 0.1);
        --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.2);
    }
}

/* Base improvements */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 50%, #fff7ed 100%);
    color: var(--slate-800);
    line-height: 1.6;
    font-size: 0.9375rem;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Scrollbar modern */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* ============================================
   HEADER - Modern Glassmorphism
   ============================================ */
.header {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(30, 64, 175, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: var(--space-5) var(--space-8);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
}

.header-icon {
    font-size: 2.25rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-1);
    background: linear-gradient(to right, #fff, #bfdbfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    color: var(--primary-200);
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Controls - layout îmbunătățit */
.controls {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================
   BUTTONS - Modern Soft UI
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    letter-spacing: 0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: var(--shadow-inner);
}

/* Button variants */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.btn-word {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-word::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.btn-word:hover::after {
    animation: shine 0.5s ease-in-out;
    opacity: 1;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.btn-word:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
}

/* Loading spinner modern */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   LAYOUT - App Container Modern
   ============================================ */
.app-container {
    display: flex;
    min-height: calc(100vh - 200px);
    max-width: 1600px;
    margin: 0 auto;
    gap: var(--space-6);
    padding: 0 var(--space-6);
}

/* ============================================
   SIDEBAR - Modern Navigation Rail
   ============================================ */
.sidebar {
    width: 260px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    position: sticky;
    top: 100px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
    z-index: 100;
}

.nav-title {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--slate-500);
    font-weight: 700;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--slate-200);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-2);
    border-radius: var(--radius-lg);
    color: var(--slate-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-500);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform var(--transition);
}

.nav-item:hover {
    background: var(--slate-100);
    color: var(--primary-700);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-50), rgba(255,255,255,0.8));
    color: var(--primary-700);
    border-color: var(--primary-200);
    font-weight: 600;
}

.nav-item.active::before {
    transform: scaleY(1);
}

/* Icon animation */
.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

/* ============================================
   MAIN CONTENT - Better Typography
   ============================================ */
.main-content {
    flex: 1;
    padding: var(--space-6) 0;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   PROGRESS BAR - Modern Linear
   ============================================ */
.progress-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    margin-bottom: var(--space-8);
    position: sticky;
    top: 90px;
    z-index: 90;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    font-weight: 600;
    color: var(--slate-700);
    font-size: 0.875rem;
}

#progressText {
    color: var(--primary-600);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    height: 6px;
    background: var(--slate-200);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-inner);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============================================
   CARDS - Modern Elevation
   ============================================ */
.section {
    margin-bottom: var(--space-8);
    scroll-margin-top: 160px;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.15s; }
.section:nth-child(3) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-200);
    overflow: hidden;
    transition: all var(--transition-slow);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--slate-300);
}

.card-header {
    background: linear-gradient(135deg, var(--slate-50), rgba(255,255,255,0.9));
    padding: var(--space-6);
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.card-icon {
    font-size: 1.75rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--slate-800);
    margin: 0;
    letter-spacing: -0.01em;
}

.card-body {
    padding: var(--space-6);
}

/* Section divider elegant */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--slate-300), transparent);
    margin: var(--space-8) 0;
    position: relative;
}

.section-divider::before {
    content: '§';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: white;
    color: var(--slate-400);
    padding: 0 var(--space-4);
    font-size: 0.875rem;
}

/* Subtitles */
h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-700);
    margin: var(--space-6) 0 var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    letter-spacing: -0.01em;
}

h3:first-child {
    margin-top: 0;
}

/* ============================================
   FORM ELEMENTS - Modern Inputs
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    color: var(--slate-700);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Inputs modern styling */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="tel"],
textarea,
select {
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    font-family: inherit;
    background: white;
    color: var(--slate-800);
    transition: all var(--transition);
    width: 100%;
    min-height: 44px;
    box-shadow: var(--shadow-xs);
}

input::placeholder,
textarea::placeholder {
    color: var(--slate-400);
    font-size: 0.875rem;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-sm);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), var(--shadow-sm);
    background: white;
}

/* Textarea specific */
textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Select modern */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Grid utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

@media (max-width: 640px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Custom Checkbox styling */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--slate-50);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    border: 1.5px solid transparent;
    min-height: 56px;
}

.checkbox-group:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary-600);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.checkbox-group span {
    font-size: 0.875rem;
    color: var(--slate-700);
    line-height: 1.4;
    font-weight: 500;
}

/* ============================================
   ACCESS STRUCTURE - Modern Cards
   ============================================ */
.access-structure-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-inner);
}

.access-category {
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-200);
    transition: all var(--transition);
}

.access-category:hover {
    box-shadow: var(--shadow);
    border-color: var(--slate-300);
}

.access-category-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary-800);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--primary-100);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    letter-spacing: -0.01em;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-3);
}

/* ============================================
   DYNAMIC ARRAY ITEMS - Modern Cards
   ============================================ */
.array-item {
    background: white;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    position: relative;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.array-item:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.array-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--slate-100);
}

.array-item-title {
    font-weight: 700;
    color: var(--primary-800);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.remove-btn {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: var(--slate-100);
    color: var(--slate-500);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition);
    font-weight: 700;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.remove-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: var(--shadow-md);
}

.add-btn {
    width: 100%;
    padding: var(--space-4);
    margin-top: var(--space-4);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 2px dashed var(--primary-300);
    color: var(--primary-700);
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 56px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.add-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.add-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-style: solid;
}

.add-btn:hover::before {
    left: 100%;
}

.add-btn:active {
    transform: translateY(0);
}

/* ============================================
   SUBSISTEM ITEMS - Modern Selection Cards
   ============================================ */
.subsistem-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.subsistem-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: white;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-xl);
    transition: all var(--transition);
    cursor: pointer;
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.subsistem-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-500);
    transform: scaleY(0);
    transition: transform var(--transition);
}

.subsistem-item:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.subsistem-item:has(input:checked) {
    border-color: var(--primary-500);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.subsistem-item:has(input:checked)::before {
    transform: scaleY(1);
}

.subsistem-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--primary-600);
    cursor: pointer;
    flex-shrink: 0;
}

.subsistem-item label {
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.9375rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.subsistem-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}

/* ============================================
   LEGAL TEXT - Better Typography
   ============================================ */
.legal-text {
    background: linear-gradient(180deg, var(--slate-50), #ffffff);
    border-left: 3px solid var(--primary-500);
    padding: var(--space-6);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--slate-600);
    font-style: italic;
    margin: var(--space-4) 0;
    white-space: pre-wrap;
    box-shadow: var(--shadow-sm);
    border-top: 1px solid var(--slate-100);
    border-right: 1px solid var(--slate-100);
    border-bottom: 1px solid var(--slate-100);
}

/* ============================================
   ANEXA ITEMS - Tags Modern Style
   ============================================ */
.anexa-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--slate-50);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    border: 1px solid var(--slate-200);
    transition: all var(--transition);
}

.anexa-item:hover {
    background: white;
    border-color: var(--primary-300);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.anexa-label {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 70px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   DYNAMIC CONTAINERS - Empty States
   ============================================ */
#structuri_container:empty::before,
#terenuri_container:empty::before,
#posturi_container:empty::before,
#consemn_particular_container:empty::before,
#contacte_container:empty::before,
#anexe_container:empty::before {
    content: 'Niciun element adăugat încă. Folosiți butonul de mai sus pentru a adăuga.';
    display: block;
    padding: var(--space-8);
    text-align: center;
    color: var(--slate-400);
    font-style: italic;
    background: var(--slate-50);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--slate-200);
    margin-bottom: var(--space-4);
}

/* Helper text modern */
.helper-text {
    color: var(--slate-500);
    font-size: 0.875rem;
    font-style: normal;
    line-height: 1.5;
    background: var(--slate-50);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent-400);
    margin-bottom: var(--space-4);
}

.warning-note {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    font-size: 0.875rem;
    margin-top: var(--space-3);
    box-shadow: var(--shadow-sm);
}

/* Spacing utilities */
.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); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

/* ============================================
   STATUS BAR - Modern Fixed Bottom
   ============================================ */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--slate-200);
    padding: var(--space-4) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 1000;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--slate-600);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--success-light);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

/* ============================================
   TOAST NOTIFICATIONS - Modern Slide
   ============================================ */
.toast {
    position: fixed;
    top: 100px;
    right: 24px;
    background: var(--slate-800);
    color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: 9999;
    font-weight: 500;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid var(--success);
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.toast.show {
    display: block;
}

.toast.error {
    border-left-color: var(--danger);
    background: var(--danger-dark);
}

.toast.warning {
    border-left-color: var(--warning);
    background: #b45309;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Hidden file input */
.hidden-file-input {
    display: none;
}

/* ============================================
   RESPONSIVE DESIGN - Mobile First
   ============================================ */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
        padding: 0 var(--space-4);
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-radius: var(--radius-xl);
        margin-bottom: var(--space-4);
        padding: var(--space-4);
        display: flex;
        gap: var(--space-2);
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .nav-title {
        display: none;
    }

    .nav-item {
        margin: 0;
        flex-shrink: 0;
        padding: var(--space-2) var(--space-4);
    }

    .nav-item::before {
        display: none;
    }

    .main-content {
        padding: 0;
    }

    .progress-container {
        position: relative;
        top: 0;
        margin-bottom: var(--space-6);
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 160px;
    }

    .header {
        padding: var(--space-4);
    }

    .header-brand {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }

    .controls {
        justify-content: center;
        gap: var(--space-2);
    }

    .btn {
        font-size: 0.8125rem;
        padding: var(--space-2) var(--space-3);
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .subsistem-container {
        grid-template-columns: 1fr;
    }

    .status-bar {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
        padding: var(--space-4);
    }

    .card-body {
        padding: var(--space-4);
    }

    .access-structure-container {
        padding: var(--space-4);
    }

    .access-category {
        padding: var(--space-4);
    }

    .toast {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .header-title h1 {
        font-size: 1.25rem;
    }

    .section {
        scroll-margin-top: 200px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT STYLES - Optimizat
   ============================================ */
@media print {
    .header,
    .sidebar,
    .status-bar,
    .controls,
    .add-btn,
    .remove-btn,
    .btn,
    .toast,
    .progress-container {
        display: none !important;
    }

    .app-container {
        display: block;
        padding: 0;
    }

    .main-content {
        max-width: 100%;
        padding: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .section {
        display: block !important;
        margin-bottom: 30px;
        animation: none;
    }

    body {
        background: white;
        font-size: 11pt;
        line-height: 1.4;
        padding-bottom: 0;
        color: #000;
    }

    .legal-text {
        border-left: 2px solid #666;
        background: #f8fafc;
    }
}

/* ============================================
   UTILITIES & ANIMATIONS
   ============================================ */
.focus-ring:focus-visible {
    outline: none;
    ring: 2px solid var(--primary-500);
    ring-offset: 2px;
}

/* Smooth transitions pentru toate elementele interactive */
button, 
a, 
input, 
textarea, 
select,
.checkbox-group,
.nav-item,
.card,
.array-item,
.subsistem-item,
.anexa-item {
    transition: all var(--transition);
}

/* Hover states pentru links */
a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

/* Selection color */
::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}
/* ============================================
   BULK ACTION BUTTONS (Bifează/Debifează tot)
   ============================================ */

/* Container pentru butoane bulk */
.checkbox-controls,
.bulk-actions {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3) 0;
    flex-wrap: wrap;
    align-items: center;
}

/* Stiluri pentru butoanele bulk individuale */
.btn-bulk,
button[class*="check-all"],
button[class*="uncheck"],
button[class*="reset"] {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: white;
    color: var(--slate-700) !important; /* Text închis, vizibil */
    border: 1.5px solid var(--slate-300);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-xs);
    text-transform: none;
    letter-spacing: 0;
}

/* Iconițe pentru butoane */
.btn-bulk::before,
button[class*="check-all"]::before {
    content: '☑️';
    font-size: 0.875rem;
}

button[class*="uncheck"]::before {
    content: '⬜';
    font-size: 0.875rem;
}

button[class*="reset"]::before {
    content: '🔄';
    font-size: 0.875rem;
}

/* Hover states */
.btn-bulk:hover,
button[class*="check-all"]:hover,
button[class*="uncheck"]:hover,
button[class*="reset"]:hover {
    background: var(--slate-50);
    border-color: var(--primary-400);
    color: var(--primary-700) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Active/Focus states */
.btn-bulk:active,
button[class*="check-all"]:active,
button[class*="uncheck"]:active,
button[class*="reset"]:active {
    transform: translateY(0);
    background: var(--slate-100);
}

/* Dacă butoanele sunt în interiorul unui container de checklist */
#consemn_general_checklist_container .checkbox-controls,
#documente_checklist_container .checkbox-controls,
#consemn_general_checklist_container .bulk-actions,
#documente_checklist_container .bulk-actions {
    background: var(--slate-50);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-200);
    margin-bottom: var(--space-4);
}

/* Variante colorate pentru distincție */
.btn-check-all,
button[class*="check-all"] {
    border-color: var(--success);
    color: var(--success-dark) !important;
}

.btn-check-all:hover,
button[class*="check-all"]:hover {
    background: var(--success-light);
    border-color: var(--success);
}

.btn-uncheck-all,
button[class*="uncheck"] {
    border-color: var(--slate-400);
    color: var(--slate-600) !important;
}

.btn-uncheck-all:hover,
button[class*="uncheck"]:hover {
    background: var(--slate-100);
    border-color: var(--slate-500);
}

.btn-reset-defaults,
button[class*="reset"] {
    border-color: var(--warning);
    color: #92400e !important;
    background: var(--warning-light);
}

.btn-reset-defaults:hover,
button[class*="reset"]:hover {
    background: #fef3c7;
    border-color: var(--warning);
    color: #b45309 !important;
}

/* ============================================
   FIX PENTRU BUTOANE GENERICE (fallback)
   ============================================ */

/* Dacă butoanele nu au clase specifice și sunt simple <button> */
#consemn_general_checklist_container button:not(.add-btn):not(.remove-btn),
#documente_checklist_container button:not(.add-btn):not(.remove-btn),
#cap4 button:not(.add-btn):not(.remove-btn):not(.btn),
#cap8 button:not(.add-btn):not(.remove-btn):not(.btn) {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-right: var(--space-2);
    margin-bottom: var(--space-2);
    background: white;
    color: var(--slate-700) !important;
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.header-icon-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}

#consemn_general_checklist_container button:not(.add-btn):not(.remove-btn):hover,
#documente_checklist_container button:not(.add-btn):not(.remove-btn):hover {
    background: var(--slate-50);
    border-color: var(--primary-400);
    color: var(--primary-700) !important;
    box-shadow: var(--shadow-sm);
}