/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --success-color: #10b981;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --button-primary-bg: #225ad5;
    --button-primary-fg: #fff;
    --accent: #ffa726;
    --table-header-bg: #202a38;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-dark: #334155;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);

    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-sm: 4px;

    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    display: none !important;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: block !important;
}

.account-status {
    display: inline-block;
    min-width: 80px;
    padding: 5px 16px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(60,60,90,0.04);
    margin-right: 6px;
    margin-bottom: 4px;
}

/* Active = blue/green gradient, white text */
.account-status.active {
    background: linear-gradient(90deg, #53c2fa 0%, #4fc67c 100%);
    color: #fff;
    border: none;
}

/* Expired = soft gray, dark text */
.account-status.expired {
    background: linear-gradient(90deg, #e3e4e8 0%, #d1d5db 100%);
    color: #7c7c91;
    border: none;
}
.status-indicator {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.4px;
}

.pulse-circle {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border-radius: 50%;
    background: #27d86c;
    box-shadow: 0 0 0 rgba(39, 216, 108, 0.7);
    animation: pulse-blink 1.4s infinite;
}

@keyframes pulse-blink {
    0% {
        box-shadow: 0 0 0 0px rgba(39, 216, 108, 0.6);
        opacity: 1;
    }
    70% {
        box-shadow: 0 0 0 8px rgba(39, 216, 108, 0);
        opacity: 0.7;
    }
    100% {
        box-shadow: 0 0 0 0px rgba(39, 216, 108, 0);
        opacity: 1;
    }
}

/* Optional: Different color for Mock status */
.status-indicator.mock .pulse-circle {
    background: #8b8b8b;
    animation: pulse-blink-mock 1.4s infinite;
}
@keyframes pulse-blink-mock {
    0% {
        box-shadow: 0 0 0 0px rgba(139,139,139, 0.6);
        opacity: 1;
    }
    70% {
        box-shadow: 0 0 0 8px rgba(139,139,139, 0);
        opacity: 0.7;
    }
    100% {
        box-shadow: 0 0 0 0px rgba(139,139,139, 0);
        opacity: 1;
    }
}


/* Login Screen Styles */
#loginScreen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#forgotPasswordScreen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#accountVerifyScreen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}
.forgot-password-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
    float: right;
}

.forgot-password-link:hover {
    color: #1d4ed8;
}


.login-card {
    width: 600px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #016BBC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.login-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.login-tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.tab-btn.active {
    background: var(--primary-color);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:disabled, select:disabled, textarea:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

input[readonly] {
    background: var(--bg-secondary);
    cursor: default;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    box-shadow: var(--shadow);
}

.btn-primary-forgot-password {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-white);
    box-shadow: var(--shadow);

}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    color: var(--text-white);
    box-shadow: var(--shadow);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-dark));
    color: var(--text-white);
    box-shadow: var(--shadow);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--text-white);
}

/* Dashboard Navbar */
.navbar {
    background: var(--bg-primary);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;           /* space between image and text */
}
.navbar-brand img {
    height: 50px;        /* adjust as needed */
    width: 50px;
    margin-right: 8px;   /* optional, for extra spacing */
}
.navbar-brand h2 {
    color: var(--text-primary);
    margin: 0;           /* remove default space above/below heading */
    font-size: 1.3rem;   /* adjust to match your UI */
    font-weight: 700;
}



.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.broker-connection {
    position: relative;
}

.broker-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--success-color);
    color: var(--text-white);
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Users Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: var(--text-white);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    border: 1px solid var(--border-color);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* Dashboard Content */
.dashboard-content {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.info-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.info-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 1.5rem;
    z-index: 1;
}

.card-content {
    z-index: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Trade Setup Section */
.trade-setup-section {
    text-align: center;
    margin-bottom: 32px;
}

/* Positions Section */
.positions-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: linear-gradient(135deg, var(--bg-dark), var(--bg-darker));
    color: var(--text-white);
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
    transform: translateX(2px);
    box-shadow: -4px 0 0 var(--primary-color);
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px !important;
}

.profit {
    color: var(--success-color);
    font-weight: 600;
}

.loss {
    color: var(--danger-color);
    font-weight: 600;
}

/* Screen Header */
.screen-header {
    background: var(--bg-primary);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: scale(1.05);
}

.screen-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Profile Screen */
.profile-content {
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.profile-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

/* Risk Metrics Screen */
.risk-metrics-content {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.risk-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.risk-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trade-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--success-color);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 10px rgba(16, 185, 129, 0.3);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

#tradeStatus {
    font-weight: 600;
    color: var(--text-secondary);
}

.risk-form {
    transition: var(--transition);
}

.risk-form.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* History Screen */
.history-content {
    padding: 24px;
}

.history-filters {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalBackdropFade 0.2s ease-out;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    animation: modalContentSlide 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: var(--bg-secondary);
    color: var(--danger-color);
}

.setup-form, .broker-form {
    padding: 32px;
}

/* Info Message */
.info-message {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    margin-top: 8px;
    border-left: 4px solid var(--info-color);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-active {
    background: #fef3c7;
    color: #92400e;
}

.status-executed {
    background: #d1fae5;
    color: #065f46;
}

.status-executed::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 2s infinite;
}

.status-closed {
    background: #fee2e2;
    color: #991b1b;
}

/* Form Validation Styles */
.form-group.has-error input,
.form-group.has-error select {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.has-success input,
.form-group.has-success select {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Enhanced Button States */
.btn:active {
    transform: translateY(1px);
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Enhanced Notification Styles */
.notification {
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.notification.success {
    border-left-color: rgba(255, 255, 255, 0.8);
}

.notification.error {
    border-left-color: rgba(255, 255, 255, 0.8);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Firefox scrollbar */
.table-container,
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

#tradeSetupBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#tradeSetupBtn:not(:disabled) {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

/* Price animation styles */
.price-up {
    color: var(--success-color) !important;
}

.price-down {
    color: var(--danger-color) !important;
}

.price-flash {
    animation: priceFlash 0.6s ease-out;
}

@keyframes priceFlash {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(16, 185, 129, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

.price-down.price-flash {
    animation: priceFlashRed 0.6s ease-out;
}

@keyframes priceFlashRed {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

#historyPager {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px 0 16px 0;
}

.history-custom-pagination {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.07em;
}

.history-pagination-btn {
    background: #3068d8;
    color: #fff;
    border: 1px solid #224488;
    border-radius: 6px;
    padding: 8px 20px;
    margin: 0 4px;
    font-size: 1.05em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(34,44,88,0.07);
    transition: background .18s, color .14s;
}
.history-pagination-btn:disabled {
    background: #d5e2fd;
    color: #999;
    cursor: not-allowed;
    border: 1px solid #d5e2fd;
}
.history-pagination-info {
    font-weight: bold;
    color: #ffa726;
    background: #2a3550;
    padding: 9px 26px;
    border-radius: 8px;
    margin: 0 8px;
    font-size: 1.13em;
    letter-spacing: 1.2px;
    box-shadow: 0 1px 2px rgba(255,167,38,0.08);
}

/* Pagination container */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 0;
    margin-top: 16px;
}

/* Pagination buttons - compact modern style */
.pagination-container button {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hover effect */
.pagination-container button:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #4f6bef;
    color: #4f6bef;
}

/* Active page indicator */
.pagination-container button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

/* Disabled state */
.pagination-container button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f9fafb;
}

/* Icon buttons (First, Prev, Next, Last) */
.pagination-container button.nav-btn {
    min-width: 70px;
}

/* Current page info (dark center button) */
.pagination-container .page-info {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    background: #1f2937;
    color: white;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    margin: 0 4px;
}

.setup-instructions {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.setup-header {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-align: center;
}

.setup-steps {
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.setup-steps li {
    margin-bottom: 12px;
    line-height: 1.4;
}

.inner-list {
    list-style: disc inside;
    margin-top: 8px;
}

.input-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.copy-input {
    user-select: all;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    font-family: monospace;
    font-size: 0.9rem;
    cursor: text;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: var(--border-radius-sm, 4px);
    cursor: pointer;
    font-size: 0.9rem;
}

.key-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.key-inputs label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    color: var(--text-primary);
}

.key-inputs input {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm, 4px);
    margin-top: 4px;
    font-size: 1rem;
}

.btn-primary {
    align-self: flex-end;
    padding: 10px 20px;
    background: var(--button-primary-bg);
    color: var(--button-primary-fg);
    border: none;
    border-radius: var(--border-radius-sm, 4px);
    cursor: pointer;
    font-size: 1rem;
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.link-button {
    display: inline-block;
    margin-top: 4px;
    padding: 6px 12px;
    background: var(--info-color);
    color: var(--text-white);
    border-radius: var(--border-radius-sm, 4px);
    text-decoration: none;
    font-size: 0.95rem;
}

.link-button:hover {
    background: var(--primary-dark);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input {
    width: 100%;
    padding: 8px 40px 8px 10px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.toggle-visibility {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    color: var(--text-secondary);
}

.toggle-visibility:focus {
    outline: none;
}


/* Smooth transition for color changes */
#nifty, #banknifty {
    transition: color 0.3s ease, transform 0.3s ease;
    border-radius: 4px;
    padding: 4px 8px;
}
/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalBackdropFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalContentSlide {
    from {
        transform: scale(0.95) translateY(-10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .navbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .uppercase-only {
        text-transform: uppercase;
    }

    .dashboard-content,
    .profile-content,
    .risk-metrics-content,
    .history-content {
        padding: 16px;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .modal-content {
        margin: 16px;
        max-width: none;
    }

    .setup-form,
    .broker-form {
        padding: 24px;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }

    /* Table Responsive */
    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
        min-width: 100px;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        position: sticky;
        left: 0;
        background: inherit;
        z-index: 1;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 2rem;
    }

    .screen-header {
        padding: 16px;
    }

    .screen-header h2 {
        font-size: 1.5rem;
    }

    .profile-card,
    .risk-card,
    .history-filters {
        padding: 24px 16px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .screen-header .back-btn,
    .btn,
    .modal {
        display: none !important;
    }

    .screen {
        display: block !important;
    }

    .data-table {
        font-size: 12px;
    }

    .info-card,
    .profile-card,
    .risk-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}