@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: var(--client-primary, #F06449);
    --primary-hover: var(--client-primary-hover, #D95338);
    --secondary: var(--client-secondary, #9349FF);
    --bg-dark: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.75);
    --bg-card-hover: rgba(51, 65, 85, 0.8);
    --border-color: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --input-bg: rgba(15, 23, 42, 0.6);
    --header-bg: rgba(15, 23, 42, 0.85);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-glow: 0 10px 30px -10px rgba(240, 100, 73, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #334155;
    --input-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.9);
    --shadow-glass: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Source Sans 3', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(240, 100, 73, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(147, 73, 255, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header & Navbar */
.app-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 24px;
    transition: background-color 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.client-logo {
    max-height: 48px;
    max-width: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.summa-header-logo {
    max-height: 40px;
    max-width: 140px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

[data-theme="light"] .summa-header-logo {
    background: transparent;
}

.client-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.user-role-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(147, 73, 255, 0.15);
    color: var(--secondary);
    font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Main Content Container */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-glass);
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.glass-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(240, 100, 73, 0.25);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

.input-group-action {
    display: flex;
    gap: 8px;
}

.input-group-action input {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(240, 100, 73, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(240, 100, 73, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .btn-secondary {
    background: #f1f5f9;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.btn-success {
    background: #059669;
    color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Wizard / Step Progress */
.wizard-header {
    margin-bottom: 30px;
}

.step-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 30px;
}

.step-progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
    transform: translateY(-50%);
}

.progress-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 2;
    transform: translateY(-50%);
    transition: width 0.3s ease;
}

.step-item {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px var(--primary);
}

.step-item.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-item.active .step-label {
    color: var(--text-main);
    font-weight: 700;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.custom-table th, .custom-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.custom-table th {
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-table tr:hover td {
    background: rgba(240, 100, 73, 0.04);
}

/* Scale selection cards for Competencies */
.scale-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.scale-option {
    position: relative;
}

.scale-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.scale-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    text-align: center;
}

.scale-option input[type="radio"]:checked + .scale-label {
    background: rgba(240, 100, 73, 0.2);
    border-color: var(--primary);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(240, 100, 73, 0.3);
}

.scale-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-info { background: rgba(147, 73, 255, 0.2); color: #9349ff; }

/* Dashboard Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(240, 100, 73, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.metric-val {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.metric-lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid #059669; color: #059669; }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid #dc2626; color: #dc2626; }

@media (max-width: 768px) {
    .scale-options {
        grid-template-columns: repeat(2, 1fr);
    }
    .step-label {
        display: none;
    }
}
