:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --accent: #0ea5e9;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --error: #ef4444;
    --success: #22c55e;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] {
    --background: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    transition: background-color 0.3s ease;
    min-height: 100vh;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes fluidFadeIn {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.fluid-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.fluid-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
}

/* Glassmorphism */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Auth Page */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    bottom: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    line-height: 1;
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fee2e2;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    height: 100%;
    position: relative;
    padding: 1.5rem;
    display: flex !important;
    flex-direction: column !important;
    border-right: 1px solid var(--border);
    background: var(--surface);
    z-index: 100;
    overflow-y: auto;
    width: 280px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.sidebar-footer-new {
    margin-top: auto;
    padding: 1.5rem 0.5rem 0.5rem 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.725rem;
    color: var(--secondary);
    line-height: 1.6;
    opacity: 0.8;
    text-align: center;
}

.sidebar-footer-new strong {
    color: var(--text-main);
}

.sidebar-header {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--primary);
    transform: translateX(8px);
    box-shadow: var(--shadow);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    padding: 1.25rem 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-left: -0.5rem;
    transition: all 0.2s ease;
}

.user-info-link:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.user-info-link:hover .user-name {
    color: var(--primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
}

.logout-btn:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.logout-btn i {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    background: var(--background);
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb span:last-child {
    color: var(--text);
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.icon-btn:hover {
    background: var(--border);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.icon-btn i {
    width: 18px;
    height: 18px;
}

/* Company Cards */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.company-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.company-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.company-card:hover::before {
    opacity: 1;
}

.company-card:hover {
    transform: translateY(-12px) scale(1.04) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
    border-color: var(--primary) !important;
}

.company-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.company-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}


/* Year Picker Styles */
.year-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.year-chip {
    padding: 10px;
    text-align: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.year-chip:hover {
    border-color: var(--primary);
    background: var(--surface);
    color: var(--primary);
}
.year-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
@media (max-width: 480px) {
    .year-picker-grid { grid-template-columns: repeat(3, 1fr); }
}


/* Layout & Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.p-6 { padding: 1.5rem; }
.rounded-xl { border-radius: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.text-xs { font-size: 0.75rem; }
.logo-preview {
    transition: all 0.3s ease;
    cursor: default;
}
.logo-preview:hover {
    border-color: var(--primary) !important;
    background: var(--background) !important;
}



/* Utils */
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }

/* Company Details */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 2rem;
}

.company-title-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.inc-badge {
    background: var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions .btn {
    width: auto !important;
    padding: 0.75rem 1.5rem;
}

.sort-control {
    padding: 4px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.category-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: var(--background);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.file-item:hover {
    background: var(--border);
}

.file-info {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    min-width: 0;
    flex: 1;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    border-radius: 8px;
    color: var(--primary);
}

.file-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: 1.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* File Grid for Documents */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Company Logos */
.company-logo-small {
    border: 1px solid var(--border);
    transition: var(--transition);
    background: var(--surface);
    position: relative;
    z-index: 2;
}

.company-card:hover .company-logo-small {
    border-color: var(--primary);
    transform: scale(1.05);
}

.company-card {
    position: relative;
    overflow: hidden;
}

.card-content-inner {
    position: relative;
    z-index: 2;
}

.company-card-bg-logo {
    position: absolute;
    right: -10%;
    top: 0;
    height: 110%;
    width: 60%;
    z-index: 1;
    opacity: 0.1;
    pointer-events: none;
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0) 80%);
}

.company-card-bg-logo img, .company-card-bg-logo i {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right center;
}

.footer {
    display: none; /* Desktop footer moved to sidebar */
}

@media (max-width: 1024px) {
    .footer {
        display: block;
        padding: 2rem 0;
        text-align: center;
        border-top: 1px solid var(--border);
    }
}

/* Floating Action Button (FAB) */
.fab {
    display: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab:hover {
    transform: scale(1.1) translateY(-5px);
    background: var(--primary-hover);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

.fab i {
    width: 28px;
    height: 28px;
}

/* Real-time Search UI */
.search-container {
    max-width: 600px;
    margin: 1.5rem 0;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), var(--shadow-lg);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.no-results {
    display: none;
    text-align: center;
    padding: 3rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    margin-top: 2rem;
}

.no-results i {
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results p {
    color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 1024px) {
    .search-container {
        max-width: 100%;
    }
}


