/* ========================================
PRAligns - Premium Intelligence Dashboard
Complete UI/UX Enhancement
======================================== */

{
margin: 0;
padding: 0;
box-sizing: border-box;
}

:root {
--primary: #0052CC;
--primary-dark: #0747A6;
--primary-light: #DEEBFF;
--primary-subtle: #F4F5F7;

--secondary: #6B778C;
--secondary-light: #F4F5F7;
--secondary-dark: #172B4D;
--secondary-subtle: #A5ADBA;

--success: #00875A;
--warning: #FFAB00;
--danger: #DE350B;

--surface: #FFFFFF;
--background: #F8F9FA;
--border: #DFE1E6;
--border-light: #EBECF0;
--border-subtle: #F4F5F7;

--low: #006644;
--low-bg: #E3FCEF;
--medium: #FF8B00;
--medium-bg: #FFFAE6;
--high: #BF2600;
--high-bg: #FFEBE6;

--shadow-sm: 0 1px 1px rgba(9,30,66,0.05);
--shadow: 0 2px 4px rgba(9,30,66,0.08);
--shadow-md: 0 4px 8px rgba(9,30,66,0.08);
--shadow-lg: 0 8px 16px rgba(9,30,66,0.08);
--shadow-xl: 0 16px 32px rgba(9,30,66,0.12);

--radius-sm: 3px;
--radius: 6px;
--radius-md: 8px;
--radius-lg: 12px;

--transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
--transition-slow: all 0.3s cubic-bezier(0.2, 0, 0, 1);

--sidebar-width: 64px;
--sidebar-expanded: 240px;
--panel-width: 480px;

--glass: rgba(255, 255, 255, 0.98);
--glass-border: rgba(255, 255, 255, 0.2);
--glass-shadow: 0 8px 32px rgba(0, 82, 204, 0.08);

--dashboard-bg: linear-gradient(135deg, #F8F9FA 0%, #F0F2F5 100%);
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
background: var(--background);
color: var(--secondary-dark);
line-height: 1.5;
font-size: 14px;
min-height: 100vh;
overflow-x: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.dashboard-page .dashboard-background,
.today-page .dashboard-background {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--dashboard-bg);
z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
color: var(--secondary-dark);
letter-spacing: -0.2px;
margin: 0;
}

h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 16px; line-height: 1.4; }
h4 { font-size: 14px; line-height: 1.4; }

/* Topbar */
.topbar {
height: 64px;
padding: 0 24px;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
background: var(--surface);
border-bottom: 1px solid var(--border);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}

.topbar-left {
display: flex;
align-items: center;
gap: 16px;
}

.topbar-subtitle {
font-size: 13px;
color: var(--secondary);
font-weight: 500;
padding-left: 12px;
border-left: 1px solid var(--border-light);
}

.sidebar-toggle {
background: none;
border: none;
width: 40px;
height: 40px;
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: var(--secondary);
transition: var(--transition);
font-size: 18px;
}

.sidebar-toggle:hover {
background: var(--primary-light);
color: var(--primary);
}

.sidebar-toggle.active {
background: var(--primary-light);
color: var(--primary);
transform: rotate(180deg);
}

.logo {
font-size: 20px;
font-weight: 800;
color: var(--secondary-dark);
letter-spacing: -0.3px;
background: linear-gradient(135deg, #0052CC 0%, #0747A6 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

.topbar-right {
display: flex;
align-items: center;
gap: 16px;
}

.btn-new-search {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border: none;
padding: 10px 20px;
border-radius: var(--radius);
font-weight: 600;
font-size: 14px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: var(--transition);
box-shadow: 0 2px 8px rgba(0, 82, 204, 0.25);
}

.btn-new-search:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(0, 82, 204, 0.35);
}

.user {
display: flex;
align-items: center;
gap: 12px;
font-size: 13px;
color: var(--secondary);
padding: 6px 12px;
border-radius: var(--radius);
background: var(--secondary-light);
border: 1px solid var(--border);
}

.user a {
color: var(--primary);
text-decoration: none;
font-weight: 500;
}

.user a:hover {
text-decoration: underline;
}

/* Container */
.container {
display: flex;
min-height: 100vh;
padding-top: 64px;
position: relative;
}

/* Sidebar - Fixed Issues */
.sidebar {
width: var(--sidebar-width);
background: var(--surface);
border-right: 1px solid var(--border);
padding: 20px 0;
transition: var(--transition-slow);
position: fixed;
top: 64px;
left: 0;
bottom: 0;
z-index: 900;
overflow: hidden;
}

.sidebar.expanded {
width: var(--sidebar-expanded);
}

.sidebar-nav {
padding: 0 12px;
margin-bottom: 20px;
}

.sidebar-nav a {
display: flex;
align-items: center;
gap: 16px;
padding: 12px;
text-decoration: none;
color: var(--secondary);
border-radius: var(--radius);
margin-bottom: 4px;
transition: var(--transition);
font-size: 14px;
font-weight: 500;
white-space: nowrap;
position: relative;
overflow: hidden;
}

.sidebar-nav a:hover {
background: var(--primary-light);
color: var(--primary);
}

.sidebar-nav a.active {
background: linear-gradient(135deg, rgba(0, 82, 204, 0.1) 0%, rgba(7, 71, 166, 0.1) 100%);
color: var(--primary);
font-weight: 600;
}

.sidebar-nav a.active::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 20px;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
border-radius: 0 3px 3px 0;
}

.sidebar-nav a i {
font-size: 18px;
width: 24px;
text-align: center;
flex-shrink: 0;
}

.sidebar-nav a span {
opacity: 0;
transition: opacity 0.2s ease;
}

.sidebar.expanded .sidebar-nav a span {
opacity: 1;
}

.sidebar-summary {
padding: 16px;
border-top: 1px solid var(--border-light);
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
margin-top: 20px;
}

.sidebar.expanded .sidebar-summary {
opacity: 1;
pointer-events: all;
}

.sidebar-summary h4 {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--secondary);
margin-bottom: 16px;
font-weight: 600;
}

.summary-card {
background: var(--surface);
border-radius: var(--radius-md);
padding: 16px;
box-shadow: var(--shadow-sm);
border: 1px solid var(--border-light);
}

.summary-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
}

.summary-item .label {
font-size: 13px;
color: var(--secondary);
font-weight: 500;
}

.summary-item .value {
font-weight: 700;
font-size: 15px;
color: var(--secondary-dark);
}

/* Main Content */
.main-content {
flex: 1;
padding: 32px;
background: transparent;
min-height: calc(100vh - 64px);
margin-left: var(--sidebar-width);
transition: margin-left 0.3s cubic-bezier(0.2, 0, 0, 1);
overflow-y: auto;
}

.sidebar.expanded ~ .main-content {
margin-left: var(--sidebar-expanded);
}

/* Dashboard Hero */
.dashboard-hero {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 32px;
padding: 0 0 48px;
margin-bottom: 32px;
}

.hero-content {
grid-column: 1;
}

.hero-metrics {
grid-column: 2;
background: var(--surface);
border-radius: var(--radius-lg);
padding: 24px;
border: 1px solid var(--border);
box-shadow: var(--shadow);
display: flex;
flex-direction: column;
}

.dashboard-hero h1 {
font-size: 36px;
margin-bottom: 12px;
background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--primary-dark) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1.2;
}

.hero-subtitle {
font-size: 16px;
color: var(--secondary);
margin-bottom: 24px;
font-weight: 500;
line-height: 1.6;
max-width: 600px;
}

.btn-hero-search {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border: none;
padding: 14px 32px;
border-radius: var(--radius);
font-size: 15px;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 12px;
transition: var(--transition);
box-shadow: 0 4px 16px rgba(0, 82, 204, 0.25);
}

.btn-hero-search:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 82, 204, 0.35);
}

.hero-metrics h3 {
font-size: 14px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--secondary);
margin-bottom: 20px;
font-weight: 600;
}

.metrics-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
}

.metric-item {
display: flex;
flex-direction: column;
gap: 4px;
}

.metric-value {
font-size: 24px;
font-weight: 800;
color: var(--secondary-dark);
line-height: 1;
}

.metric-label {
font-size: 12px;
color: var(--secondary);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.metric-highlight {
color: var(--primary);
}

/* Stats Grid */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 20px;
margin-bottom: 32px;
}

.stat-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
display: flex;
align-items: center;
gap: 16px;
transition: var(--transition);
box-shadow: var(--shadow);
}

.stat-card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg);
}

.stat-icon {
width: 48px;
height: 48px;
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 20px;
}

.stat-content {
flex: 1;
}

.stat-value {
font-size: 28px;
font-weight: 800;
color: var(--secondary-dark);
line-height: 1;
margin-bottom: 4px;
}

.stat-label {
font-size: 14px;
color: var(--secondary);
font-weight: 500;
}

/* Content Filters */
.content-filters {
display: flex;
gap: 8px;
margin-bottom: 32px;
flex-wrap: wrap;
padding: 16px;
background: var(--surface);
border-radius: var(--radius-lg);
border: 1px solid var(--border);
box-shadow: var(--shadow-sm);
}

.filter-btn {
background: var(--surface);
border: 1px solid var(--border);
color: var(--secondary);
padding: 8px 16px;
border-radius: var(--radius);
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
display: flex;
align-items: center;
gap: 8px;
}

.filter-btn:hover {
background: var(--secondary-light);
color: var(--secondary-dark);
}

.filter-btn.active {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border-color: var(--primary);
}

/* Quality Message */
.quality-message {
background: linear-gradient(135deg, var(--low-bg) 0%, rgba(227, 252, 239, 0.6) 100%);
border: 1px solid rgba(0, 102, 68, 0.2);
border-radius: var(--radius-lg);
padding: 20px;
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 24px;
}

.quality-message i {
font-size: 24px;
color: var(--low);
}

.quality-message-content {
flex: 1;
}

.quality-message h4 {
font-size: 16px;
color: var(--secondary-dark);
margin-bottom: 4px;
}

.quality-message p {
font-size: 14px;
color: var(--secondary);
}

/* Cards Grid */
.cards-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 48px;
}

/* PR Card - Compact Design */
.pr-card {
background: var(--surface);
border-radius: var(--radius-lg);
overflow: hidden;
padding: 20px;
transition: var(--transition);
border: 1px solid var(--border);
display: flex;
flex-direction: column;
position: relative;
min-height: 320px;
}

.pr-card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg);
border-color: var(--primary-light);
}

.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border-light);
}

.card-source-badge {
font-size: 11px;
font-weight: 800;
color: var(--secondary-dark);
letter-spacing: 0.5px;
text-transform: uppercase;
padding: 4px 8px;
background: var(--secondary-light);
border-radius: var(--radius);
}

.card-date {
font-size: 12px;
color: var(--secondary);
font-weight: 500;
}

.card-scores {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 16px;
padding-bottom: 16px;
border-bottom: 1px solid var(--border-light);
}

.score-ring {
position: relative;
width: 60px;
height: 60px;
flex-shrink: 0;
}

.score-ring svg {
transform: rotate(-90deg);
}

.score-ring-bg {
stroke: var(--border-light);
fill: none;
stroke-width: 4;
}

.score-ring-value {
stroke: var(--primary);
fill: none;
stroke-width: 4;
stroke-linecap: round;
transition: stroke-dashoffset 0.6s ease;
}

.score-ring-value.high {
stroke: var(--high);
}

.score-ring-value.medium {
stroke: var(--medium);
}

.score-ring-value.low {
stroke: var(--low);
}

.score-value {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 16px;
font-weight: 800;
color: var(--secondary-dark);
}

.score-bar {
flex: 1;
}

.score-bar-label {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--secondary);
font-weight: 600;
margin-bottom: 4px;
display: flex;
justify-content: space-between;
}

.score-bar-track {
height: 6px;
background: var(--border-light);
border-radius: 3px;
overflow: hidden;
margin-bottom: 4px;
}

.score-bar-fill {
height: 100%;
background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
border-radius: 3px;
transition: width 0.6s ease;
}

.score-bar-value {
font-size: 12px;
font-weight: 700;
color: var(--secondary-dark);
}

.card-title {
font-size: 14px;
font-weight: 700;
line-height: 1.5;
color: var(--secondary-dark);
margin-bottom: 16px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
flex: 1;
}

/* Enhanced Meta Grid - Multi-color Design */
.card-meta-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
margin-bottom: 16px;
padding: 12px;
background: linear-gradient(135deg, rgba(244, 245, 247, 0.5) 0%, rgba(235, 236, 240, 0.5) 100%);
border-radius: var(--radius);
}

.meta-item {
display: flex;
flex-direction: column;
gap: 4px;
}

.meta-label {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--secondary);
font-weight: 600;
}

.meta-value {
font-size: 12px;
font-weight: 700;
padding: 4px 8px;
border-radius: var(--radius-sm);
text-align: center;
border: 1px solid;
}

/* Impact Colors */
.meta-value.high {
color: var(--high);
background: linear-gradient(135deg, var(--high-bg) 0%, rgba(255, 235, 230, 0.5) 100%);
border-color: rgba(191, 38, 0, 0.2);
}

.meta-value.medium {
color: var(--medium);
background: linear-gradient(135deg, var(--medium-bg) 0%, rgba(255, 250, 230, 0.5) 100%);
border-color: rgba(255, 139, 0, 0.2);
}

.meta-value.low {
color: var(--low);
background: linear-gradient(135deg, var(--low-bg) 0%, rgba(227, 252, 239, 0.5) 100%);
border-color: rgba(0, 102, 68, 0.2);
}

.meta-value.primary {
color: var(--primary);
background: linear-gradient(135deg, var(--primary-light) 0%, rgba(222, 235, 255, 0.5) 100%);
border-color: rgba(0, 82, 204, 0.2);
}

/* Score Drivers */
.score-drivers {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-bottom: 16px;
}

.driver-tag {
background: white;
color: var(--secondary-dark);
padding: 3px 8px;
border-radius: var(--radius-sm);
font-size: 10px;
font-weight: 600;
border: 1px solid var(--border-light);
display: inline-flex;
align-items: center;
gap: 3px;
}

.driver-tag i {
font-size: 9px;
}

.card-footer {
display: flex;
gap: 8px;
margin-top: auto;
}

.btn-view-details {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border: none;
padding: 8px 16px;
border-radius: var(--radius);
font-size: 12px;
font-weight: 700;
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
transition: var(--transition);
flex: 1;
justify-content: center;
box-shadow: 0 2px 8px rgba(0, 82, 204, 0.25);
}

.btn-view-details:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 82, 204, 0.35);
}

.btn-read-more {
background: white;
color: var(--secondary);
border: 1px solid var(--border);
padding: 8px 16px;
border-radius: var(--radius);
font-size: 12px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
transition: var(--transition);
text-decoration: none;
flex: 1;
justify-content: center;
}

.btn-read-more:hover {
background: var(--secondary-light);
color: var(--secondary-dark);
border-color: var(--secondary);
}

/* Impact List Card */
.impact-list-card {
grid-column: 2;
}

.impact-list {
display: flex;
flex-direction: column;
gap: 8px;
margin: 16px 0;
}

.impact-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
background: white;
border: 1px solid var(--border-light);
border-radius: var(--radius);
cursor: pointer;
transition: var(--transition);
position: relative;
}

.impact-item:hover {
background: var(--primary-light);
border-color: var(--primary);
transform: translateX(4px);
}

.impact-rank {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
flex-shrink: 0;
}

.rank-number {
font-size: 16px;
font-weight: 800;
color: var(--secondary-dark);
}

.impact-dot {
width: 8px;
height: 8px;
border-radius: 50%;
}

.impact-dot.high {
background: var(--high);
}

.impact-dot.medium {
background: var(--medium);
}

.impact-dot.low {
background: var(--low);
}

.impact-content {
flex: 1;
min-width: 0;
}

.impact-title {
font-size: 12px;
font-weight: 600;
color: var(--secondary-dark);
line-height: 1.4;
margin-bottom: 4px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.impact-meta {
display: flex;
align-items: center;
gap: 8px;
font-size: 10px;
color: var(--secondary);
}

.impact-score {
display: flex;
align-items: center;
gap: 3px;
font-weight: 700;
color: var(--primary);
}

.impact-source {
font-weight: 600;
}

.impact-arrow {
color: var(--secondary);
transition: transform 0.3s ease;
}

.impact-item:hover .impact-arrow {
transform: translateX(4px);
color: var(--primary);
}

.no-impact {
text-align: center;
padding: 20px;
color: var(--secondary);
}

.no-impact i {
font-size: 24px;
margin-bottom: 8px;
opacity: 0.5;
}

.no-impact p {
font-size: 12px;
line-height: 1.5;
}

/* Today Cards Layout */
.today-cards {
display: grid;
grid-template-columns: 1fr;
gap: 20px;
margin-bottom: 48px;
}

/* Past Searches - Enhanced */
.past-searches {
margin-top: 48px;
padding-top: 32px;
border-top: 1px solid var(--border-light);
}

.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
}

.section-header h2 {
font-size: 18px;
font-weight: 700;
color: var(--secondary-dark);
position: relative;
padding-left: 12px;
}

.section-header h2::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 20px;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
border-radius: 1.5px;
}

.view-all {
font-size: 14px;
color: var(--primary);
text-decoration: none;
display: flex;
align-items: center;
gap: 8px;
font-weight: 600;
padding: 8px 16px;
border-radius: var(--radius);
transition: var(--transition);
}

.view-all:hover {
background: var(--primary-light);
text-decoration: none;
transform: translateX(4px);
}

.past-list {
display: flex;
flex-direction: column;
gap: 24px;
}

.past-group h3 {
font-size: 16px;
font-weight: 700;
margin-bottom: 16px;
color: var(--secondary-dark);
padding-bottom: 8px;
border-bottom: 1px solid var(--border-light);
}

.past-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 16px;
}

.past-card {
background: var(--surface);
border: 1px solid var(--border-light);
border-radius: var(--radius);
padding: 16px;
display: flex;
justify-content: space-between;
align-items: center;
transition: var(--transition);
box-shadow: var(--shadow-sm);
}

.past-card:hover {
border-color: var(--primary);
box-shadow: var(--shadow-md);
transform: translateY(-4px);
}

.past-card-content h4 {
font-size: 14px;
font-weight: 600;
margin-bottom: 6px;
line-height: 1.4;
color: var(--secondary-dark);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}

.past-card-meta {
display: flex;
gap: 12px;
font-size: 12px;
color: var(--secondary);
align-items: center;
}

.impact-small {
padding: 4px 10px;
border-radius: 12px;
font-weight: 700;
font-size: 11px;
}

.impact-small.high {
background: var(--high-bg);
color: var(--high);
border: 1px solid rgba(191, 38, 0, 0.2);
}

.impact-small.medium {
background: var(--medium-bg);
color: var(--medium);
border: 1px solid rgba(255, 139, 0, 0.2);
}

.impact-small.low {
background: var(--low-bg);
color: var(--low);
border: 1px solid rgba(0, 102, 68, 0.2);
}

.past-card-link {
color: var(--secondary);
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius);
transition: var(--transition);
background: var(--secondary-light);
}

.past-card-link:hover {
background: var(--primary);
color: white;
transform: rotate(45deg);
}

/* Panel Overlay & Panel - Fixed Overlap */
.panel-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(9, 30, 66, 0.8);
z-index: 1100;
opacity: 0;
visibility: hidden;
transition: var(--transition-slow);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
}

.panel-overlay.active {
opacity: 1;
visibility: visible;
}

.panel {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: min(520px, 100vw);
background: var(--surface);
box-shadow: var(--shadow-xl);
z-index: 1101;
transform: translateX(100%);
transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
display: flex;
flex-direction: column;
overflow: hidden;
border-left: 1px solid var(--border);
}

.panel.active {
transform: translateX(0);
}

.panel-header {
padding: 24px;
border-bottom: 1px solid var(--border-light);
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-shrink: 0;
background: linear-gradient(135deg, rgba(0, 82, 204, 0.05) 0%, rgba(7, 71, 166, 0.05) 100%);
}

.panel-header-content {
flex: 1;
}

.panel-header h2 {
font-size: 20px;
font-weight: 700;
line-height: 1.4;
margin-bottom: 12px;
color: var(--secondary-dark);
}

.panel-header-meta {
display: flex;
gap: 16px;
font-size: 14px;
color: var(--secondary);
flex-wrap: wrap;
align-items: center;
}

.panel-close {
background: white;
border: 1px solid var(--border);
color: var(--secondary);
width: 40px;
height: 40px;
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: var(--transition);
flex-shrink: 0;
margin-left: 16px;
}

.panel-close:hover {
background: var(--danger);
color: white;
border-color: var(--danger);
transform: rotate(90deg);
}

.panel-content {
flex: 1;
overflow-y: auto;
padding: 24px;
}

.panel-score-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 16px;
margin-bottom: 32px;
}

.score-item {
background: linear-gradient(135deg, var(--primary-light) 0%, rgba(222, 235, 255, 0.6) 100%);
padding: 20px;
border-radius: var(--radius-lg);
text-align: center;
border: 1px solid var(--border-light);
transition: var(--transition);
}

.score-item:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-md);
}

.score-value {
font-size: 32px;
font-weight: 800;
color: var(--primary);
line-height: 1;
margin-bottom: 8px;
}

.score-label {
font-size: 12px;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--secondary);
font-weight: 600;
}

.panel-section {
margin-bottom: 28px;
padding-bottom: 24px;
border-bottom: 1px solid var(--border-light);
}

.panel-section:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}

.panel-section h3 {
font-size: 14px;
font-weight: 700;
margin-bottom: 16px;
color: var(--secondary-dark);
text-transform: uppercase;
letter-spacing: 1px;
display: flex;
align-items: center;
gap: 8px;
}

.panel-section h3::before {
content: '';
width: 4px;
height: 16px;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
border-radius: 2px;
}

.panel-section p {
font-size: 15px;
line-height: 1.7;
color: var(--secondary-dark);
}

.panel-quotes {
display: flex;
flex-direction: column;
gap: 20px;
}

.panel-quote {
background: linear-gradient(135deg, var(--secondary-light) 0%, rgba(244, 245, 247, 0.8) 100%);
padding: 20px;
border-radius: var(--radius-lg);
border-left: 4px solid var(--primary);
position: relative;
overflow: hidden;
}

.panel-quote::before {
content: '"';
position: absolute;
top: 10px;
left: 10px;
font-size: 60px;
color: rgba(0, 82, 204, 0.1);
font-family: serif;
}

.panel-quote p {
font-size: 15px;
line-height: 1.7;
color: var(--secondary-dark);
margin-bottom: 16px;
position: relative;
z-index: 1;
font-style: italic;
}

.btn-copy {
background: white;
border: 1px solid var(--border);
color: var(--secondary);
padding: 10px 16px;
border-radius: var(--radius);
font-size: 13px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: var(--transition);
}

.btn-copy:hover {
background: var(--primary);
color: white;
border-color: var(--primary);
}

.btn-copy.copied {
background: var(--success);
color: white;
border-color: var(--success);
}

.panel-actions {
display: flex;
gap: 16px;
margin-top: 32px;
}

.btn-panel-primary {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border: none;
padding: 16px 24px;
border-radius: var(--radius);
font-weight: 700;
font-size: 15px;
cursor: pointer;
display: flex;
align-items: center;
gap: 12px;
flex: 1;
justify-content: center;
transition: var(--transition);
}

.btn-panel-primary:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
}

/* Modal - Enhanced */
.modal-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(9, 30, 66, 0.9);
z-index: 1200;
opacity: 0;
transition: opacity 0.4s ease;
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}

.modal-overlay.show {
opacity: 1;
display: flex;
align-items: center;
justify-content: center;
}

.modal-content {
background: var(--surface);
border-radius: var(--radius-lg);
width: 90%;
max-width: 600px;
max-height: 90vh;
overflow-y: auto;
transform: translateY(30px) scale(0.95);
transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
box-shadow: var(--shadow-xl);
border: 1px solid var(--border);
}

.modal-overlay.show .modal-content {
transform: translateY(0) scale(1);
}

.modal-header {
padding: 24px;
border-bottom: 1px solid var(--border-light);
display: flex;
justify-content: space-between;
align-items: center;
background: linear-gradient(135deg, rgba(0, 82, 204, 0.05) 0%, rgba(7, 71, 166, 0.05) 100%);
}

.modal-header h2 {
font-size: 22px;
font-weight: 700;
color: var(--secondary-dark);
}

.modal-close {
background: white;
border: 1px solid var(--border);
color: var(--secondary);
width: 40px;
height: 40px;
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: var(--transition);
}

.modal-close:hover {
background: var(--danger);
color: white;
border-color: var(--danger);
transform: rotate(90deg);
}

.search-form {
padding: 24px;
}

.form-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 24px;
margin-bottom: 32px;
}

.form-group {
display: flex;
flex-direction: column;
gap: 8px;
}

.form-group label {
font-size: 14px;
font-weight: 600;
color: var(--secondary-dark);
display: flex;
align-items: center;
gap: 10px;
}

.form-group input {
padding: 12px 16px;
border: 1px solid var(--border);
border-radius: var(--radius);
font-size: 14px;
transition: var(--transition);
background: var(--surface);
}

.form-group input:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.2);
}

.form-actions {
display: flex;
justify-content: flex-end;
gap: 16px;
padding-top: 24px;
border-top: 1px solid var(--border);
}

.btn-primary {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border: none;
padding: 14px 28px;
border-radius: var(--radius);
font-weight: 700;
font-size: 15px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 12px;
transition: var(--transition);
}

.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 82, 204, 0.25);
}

.btn-secondary {
background: white;
color: var(--secondary);
border: 1px solid var(--border);
padding: 14px 28px;
border-radius: var(--radius);
font-weight: 600;
font-size: 15px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 12px;
transition: var(--transition);
}

.btn-secondary:hover {
background: var(--secondary-light);
color: var(--secondary-dark);
}

/* Empty State */
.empty-state {
text-align: center;
padding: 64px 32px;
background: var(--surface);
border-radius: var(--radius-lg);
border: 2px dashed var(--border);
max-width: 480px;
margin: 40px auto;
}

.empty-state i {
font-size: 56px;
color: var(--primary-light);
margin-bottom: 24px;
opacity: 0.8;
}

.empty-state h3 {
font-size: 20px;
font-weight: 700;
margin-bottom: 12px;
color: var(--secondary-dark);
}

.empty-state p {
color: var(--secondary);
margin-bottom: 32px;
max-width: 320px;
margin-left: auto;
margin-right: auto;
font-size: 15px;
line-height: 1.6;
}

/* Pagination */
.pagination {
display: flex;
justify-content: center;
gap: 8px;
margin-top: 48px;
}

.pagination a {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius);
text-decoration: none;
color: var(--secondary);
font-size: 14px;
font-weight: 600;
transition: var(--transition);
border: 1px solid transparent;
background: white;
}

.pagination a:hover {
background: var(--primary-light);
color: var(--primary);
}

.pagination a.active {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
border-color: var(--primary);
}

/* Toast */
.toast {
position: fixed;
bottom: 32px;
right: 32px;
background: var(--surface);
border-radius: var(--radius);
padding: 16px 20px;
display: flex;
align-items: center;
gap: 12px;
box-shadow: var(--shadow-xl);
border-left: 4px solid var(--primary);
transform: translateX(120%);
transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1);
z-index: 1300;
min-width: 300px;
max-width: 400px;
}

.toast.show {
transform: translateX(0);
}

.toast i {
font-size: 20px;
color: var(--primary);
}

.toast span {
font-size: 14px;
font-weight: 600;
color: var(--secondary-dark);
}

/* Responsive */
@media (max-width: 1200px) {
.cards-grid {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.hero-metrics {
grid-column: 1 / -1;
}
}

@media (max-width: 992px) {
.main-content {
padding: 24px;
}

.dashboard-hero {
grid-template-columns: 1fr;
gap: 24px;
}

.stats-grid {
grid-template-columns: repeat(2, 1fr);
}
}

@media (max-width: 768px) {
.topbar {
padding: 0 16px;
}

.sidebar {
transform: translateX(-100%);
}

.sidebar.active {
transform: translateX(0);
}

.main-content {
margin-left: 0 !important;
padding: 20px;
}

.dashboard-hero h1 {
font-size: 28px;
}

.hero-subtitle {
font-size: 14px;
}

.stats-grid {
grid-template-columns: 1fr;
gap: 16px;
}

.cards-grid {
grid-template-columns: 1fr;
gap: 16px;
}

.content-filters {
overflow-x: auto;
padding-bottom: 8px;
flex-wrap: nowrap;
}

.card-scores {
flex-direction: column;
align-items: flex-start;
gap: 12px;
}

.score-bar {
width: 100%;
}

.card-footer {
flex-direction: column;
}

.btn-view-details,
.btn-read-more {
width: 100%;
}

.panel {
width: 100vw;
}

.modal-content {
width: 95%;
margin: 20px;
}

.past-cards {
grid-template-columns: 1fr;
}
}

@media (max-width: 480px) {
.topbar-right {
gap: 12px;
}

.btn-new-search span {
display: none;
}

.user span {
display: none;
}

.dashboard-hero {
padding: 24px 0 32px;
}

.dashboard-hero h1 {
font-size: 24px;
}

.btn-hero-search {
padding: 14px 24px;
font-size: 14px;
}

.card-header {
flex-direction: column;
align-items: flex-start;
gap: 8px;
}

.card-title {
padding-right: 0;
}

.panel-header {
flex-direction: column;
gap: 16px;
}

.panel-close {
align-self: flex-end;
}

.panel-score-grid {
grid-template-columns: 1fr;
}
}