/* Modern Design System - Daily Stock Report */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Semantic Colors - Premium SaaS Palette */
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-dark: #2563eb;
    /* Blue 600 */
    --primary-light: #eff6ff;
    /* Blue 50 */

    --secondary-color: #64748b;
    /* Slate 500 */
    --secondary-dark: #475569;
    /* Slate 600 */
    --secondary-light: #f1f5f9;
    /* Slate 100 */

    --success-color: #10b981;
    /* Emerald 500 */
    --success-bg: #ecfdf5;
    /* Emerald 50 */

    --danger-color: #ef4444;
    /* Red 500 */
    --danger-bg: #fef2f2;
    /* Red 50 */

    --warning-color: #f59e0b;
    /* Amber 500 */
    --warning-bg: #fffbeb;
    /* Amber 50 */

    /* Backgrounds */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Text */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-secondary: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #ffffff;

    /* Borders & Dividers */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --border-color-light: #f1f5f9;

    /* Radius */
    --border-radius-sm: 0.375rem;
    /* 6px */
    --border-radius: 0.5rem;
    /* 8px */
    --border-radius-lg: 0.75rem;
    /* 12px */
    --border-radius-xl: 1rem;
    /* 16px */

    /* Shadows (Soft & Premium) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-md: 0 6px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.01);

    /* Layout */
    --container-width: 1280px;
    --header-height: 72px;
}

/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1rem;
}

.container-fluid {
    width: 100%;
    padding: 1rem 1rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.grid {
    display: grid;
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.p-4 {
    padding: 1rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.25;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.text-subtle {
    color: var(--text-muted);
}

/* Header & Navigation - Premium SaaS Style */
.app-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.025em;
    user-select: none;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-item {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.625rem 1rem;
    position: relative;
    transition: all 0.2s;
    border-radius: var(--border-radius);
}

.nav-item span {
    position: relative;
    z-index: 1;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: var(--bg-body);
}

.nav-item.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 3px 3px 0 0;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    /* Subtle lift for cards */
    /* box-shadow: var(--shadow-md);  */
}

.card-header {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* Buttons - Premium SaaS Style */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    line-height: 1;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary-light);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Tables - Premium SaaS Look */
.table-container {
    overflow-x: hidden;
    /* Changed from auto to hidden for cleaner look initially, scroll if needed */
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: white;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Badges / Chips */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-success {
    background-color: var(--success-bg);
    color: #047857;
}

.badge-warning {
    background-color: var(--warning-bg);
    color: #b45309;
}

.badge-blue {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* Forms */
.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    /* Blue ring */
}

/* Dashboard Specifics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.stat-icon.green {
    background-color: var(--success-bg);
    color: var(--success-color);
}

.stat-icon.amber {
    background-color: var(--warning-bg);
    color: var(--warning-color);
}

.stat-icon.slate {
    background-color: var(--secondary-light);
    color: var(--secondary-dark);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* Reports Specifics */
.report-diff-positive {
    color: var(--success-color);
}

.report-diff-negative {
    color: var(--danger-color);
}

/* JSpreadsheet Overrides for Premium SaaS Look */
.jexcel_content {
    box-shadow: none !important;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Inter', sans-serif !important;
}

.jexcel>thead>tr>td {
    background-color: var(--bg-body) !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 10px !important;
    text-transform: uppercase;
    font-size: 0.7rem !important;
    letter-spacing: 0.05em;
}

.jexcel>tbody>tr>td {
    color: var(--text-secondary) !important;
    padding: 0.5rem !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 0.85rem !important;
}

.jexcel>tbody>tr>td.readonly {
    background-color: #f9fafb !important;
    /* Very light gray */
    color: var(--text-muted) !important;
}

/* Login Page Modernization - Refined */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    /* Deep Blue Gradient */
    font-family: 'Inter', sans-serif;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo-container {
    width: 80px;
    height: 80px;
    background-color: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.login-logo-container svg {
    color: #3b82f6;
    width: 40px;
    height: 40px;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 1rem;
    color: #64748b;
    font-weight: 400;
}

.input-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 10;
}

.login-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem !important;
    height: 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.2s;
}

.login-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.login-input::placeholder {
    color: #94a3b8;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: #2563eb;
    /* Stronger Blue */
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-login:hover {
    background-color: #1d4ed8;
}

.sync-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.sync-alert.warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}