/* MT5 Master Pro — Trading Plan Page Styles */

/* Page Header */
.plan-page-header {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    margin-bottom: 20px;
}

.plan-header-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md, 8px);
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-primary);
}

.plan-header-icon svg { color: var(--color-primary); }

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 2px;
}

/* Account Select */
.account-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    padding: 8px 32px 8px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%239ca3af' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
}

.account-select:hover {
    border-color: var(--text-muted);
}

.account-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.account-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Icon Action Buttons */
.icon-action-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.icon-action-btn.edit-accent { color: var(--color-primary); }
.icon-action-btn.edit-accent:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-primary);
}

.icon-action-btn.add-accent { color: #10b981; }
.icon-action-btn.add-accent:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.icon-action-btn.export-accent { color: #f59e0b; }
.icon-action-btn.export-accent:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.icon-action-btn.recalc-accent { color: #8b5cf6; }
.icon-action-btn.recalc-accent:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
}

/* Summary Cards */
.summary-card {
    border-radius: var(--radius-md, 8px);
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid transparent;
}

.summary-card--blue  { border-left-color: var(--color-primary); }
.summary-card--green { border-left-color: #10b981; }
.summary-card--amber { border-left-color: #f59e0b; }
.summary-card--purple { border-left-color: #8b5cf6; }

.summary-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-card__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.summary-card__icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-card__icon--blue   { background: rgba(59, 130, 246, 0.1); color: var(--color-primary); }
.summary-card__icon--green  { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.summary-card__icon--amber  { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.summary-card__icon--purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.summary-card__value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Settings Labels & Action Buttons */
.settings-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.settings-action-btn.danger-btn {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.settings-action-btn.danger-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

.settings-action-btn.primary-btn {
    background: var(--color-primary);
    color: white;
}
.settings-action-btn.primary-btn:hover {
    opacity: 0.9;
}

/* Instructions Card */
.instructions-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md, 8px);
    padding: 16px;
    margin-top: 24px;
}

/* Plan Table Card */
.plan-table-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
}

/* Add Account Dialog */
.add-account-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.add-account-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.dialog-header {
    margin-bottom: 20px;
}

.dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.dialog-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.inline-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-primary);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.inline-input-group:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.inline-input-group .inline-label {
    flex-shrink: 0;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    height: 42px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    user-select: none;
}

.inline-input-group .dialog-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 14px;
    height: 42px;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
}

.inline-input-group .dialog-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 8px 18px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.dialog-btn-cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.dialog-btn-cancel:hover {
    border-color: var(--text-muted);
}

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

.dialog-btn-create:hover {
    opacity: 0.9;
}

.dialog-btn-create:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Account Number Input */
.account-number-input {
    width: 120px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    cursor: not-allowed;
    opacity: 0.7;
}

.account-number-input:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Settings Toggle Bar */
.settings-toggle-bar {
    background: var(--color-primary);
    height: 36px;
    border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.settings-toggle-bar:hover {
    opacity: 0.9;
}

.settings-toggle-bar.active {
    border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
}

/* Settings Panel */
.settings-panel {
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: none;
}

.settings-panel.open {
    max-height: 400px !important;
    opacity: 1 !important;
}

/* Plan Table Styles */
.plan-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.plan-table-scroll {
    max-height: calc(48px * 15 + 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.plan-table-scroll::-webkit-scrollbar { width: 6px; }
.plan-table-scroll::-webkit-scrollbar-track { background: transparent; }
.plan-table-scroll::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.plan-table-wrapper {
    position: relative;
    overflow: visible;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.plan-table-wrapper.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Panel Styles */
.loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg, 12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.loading-panel.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.loading-subtext { font-size: 0.8125rem; color: var(--text-muted); }

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== STICKY HEADER & FOOTER with SOLID backgrounds ===== */
.plan-table thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 6;
}
.plan-table thead tr:nth-child(2) th {
    position: sticky;
    top: 38px;
    z-index: 5;
}

.plan-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 6;
}

/* ===== HEADER CELLS ===== */
.plan-th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.plan-th-group {
    padding: 9px 14px;
    text-align: center;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.expected-header {
    background: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border-bottom: 2px solid #10b981;
}

.actual-header {
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
    border-bottom: 2px solid #f59e0b;
}

.plan-th-sub {
    padding: 8px 14px;
    text-align: center;
    font-weight: 600;
    font-size: 0.6875rem;
}

.expected-sub {
    background: rgba(16, 185, 129, 0.05);
    color: #6ee7b7;
}

.actual-sub {
    background: rgba(245, 158, 11, 0.05);
    color: #fcd34d;
}

/* ===== TABLE BODY ===== */
.plan-td {
    padding: 10px 12px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    background: transparent;
}

.plan-tr {
    transition: background 0.15s ease;
}

.plan-tr:hover {
    background: rgba(59, 130, 246, 0.03);
}

.plan-tr:nth-child(even) {
    background: var(--bg-tertiary);
}
.plan-tr:nth-child(even):hover {
    background: rgba(59, 130, 246, 0.05);
}

.plan-tr.weekend {
    background: rgba(139, 92, 246, 0.03);
}
.plan-tr.weekend:hover {
    background: rgba(139, 92, 246, 0.06);
}

.plan-tr.weekend .plan-td {
    color: var(--text-muted);
}

/* ===== FOOTER / TOTAL ROW ===== */
.plan-total-row {
    background: var(--bg-secondary);
}

.plan-total-row .plan-td {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    border-bottom: none;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--text-primary);
    padding: 14px 12px;
}

.plan-total-row .separator-col {
    background: var(--bg-secondary) !important;
    border-left: 2px solid var(--border-color) !important;
    border-right: 2px solid var(--border-color) !important;
}

/* ===== EDITABLE CELLS ===== */
.editable-cell {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 6px);
    padding: 7px 8px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    width: 80px;
    text-align: center;
    transition: all 0.2s ease;
}

.editable-cell:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.note-input {
    width: 120px;
}

/* ===== ACTION BUTTONS ===== */
.action-btn {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.action-btn:hover {
    color: var(--color-primary);
}

.action-btn.save-btn:hover {
    color: #10b981;
}

.action-cell {
    overflow: visible;
}

.icon-btn {
    background-color: transparent;
    outline: none;
    position: relative;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.icon-btn__back { display: none; }

.icon-btn__front {
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn__icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
}

.icon-btn__label {
    font-size: 0.6875rem;
    white-space: nowrap;
    text-align: center;
    line-height: 2;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    right: 0;
    left: 0;
    color: var(--text-primary);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.icon-btn:hover .icon-btn__label {
    opacity: 1;
}

/* Status Indicators */
.status-positive {
    color: #10b981;
}

.status-negative {
    color: #ef4444;
}

.status-neutral {
    color: var(--text-secondary);
}

/* Today Row Styles */
.today-row {
    background: rgba(59, 130, 246, 0.06) !important;
}

.today-row > td {
    background: transparent;
}

.today-row > td:first-child {
    position: relative;
}

.today-row > td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
}

.today-row .plan-td {
    border-bottom-color: rgba(59, 130, 246, 0.15);
}

/* Floating Today Marker */
.today-marker {
    position: absolute;
    left: -56px;
    top: 0;
    transform: translateY(-50%);
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 6px);
    white-space: nowrap;
    z-index: 20;
    pointer-events: none;
}

.today-marker::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid var(--color-primary);
}

/* Confirmed / Locked Cells */
.confirmed-cell {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.future-cell {
    background: transparent !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.4;
}

.future-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--text-muted);
    opacity: 0.3;
}

.confirmed-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm, 6px);
    background: rgba(139, 92, 246, 0.08);
    color: #a78bfa;
}

/* Confirm Dialog */
.confirm-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 24px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.confirm-dialog__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.confirm-dialog__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.confirm-dialog__text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.confirm-dialog__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-dialog__btn {
    padding: 8px 20px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.confirm-dialog__btn--cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.confirm-dialog__btn--cancel:hover {
    border-color: var(--text-muted);
}

.confirm-dialog__btn--confirm {
    background: #f59e0b;
    color: white;
}
.confirm-dialog__btn--confirm:hover {
    opacity: 0.9;
}

/* Save Changes Bar */
.save-changes-bar {
    margin-top: 16px;
    margin-bottom: 8px;
    opacity: 1;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.save-changes-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.change-count-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    padding: 6px 14px;
    border-radius: var(--radius-full, 9999px);
    letter-spacing: 0.02em;
}

.save-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: var(--color-success);
    color: white;
    transition: all 0.2s ease;
}

.save-all-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.save-all-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.save-all-btn.saving {
    opacity: 0.7;
    pointer-events: none;
}

/* Info Button */
.icon-action-btn.info-accent { color: var(--text-muted); opacity: 0.6; }
.icon-action-btn.info-accent:hover {
    opacity: 1;
    color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-primary);
}


/* Instructions Popup */
.instructions-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.instructions-popup {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.instructions-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.instructions-popup__header h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.instructions-popup__close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-popup__close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.instructions-popup ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.instructions-popup ul li {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: 4px 0 4px 20px;
    position: relative;
}

.instructions-popup ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0.5;
}

.instructions-popup ul li strong {
    color: var(--text-primary);
}

/* Separator Column between Expected and Actual */
.separator-col {
    width: 4px !important;
    min-width: 4px !important;
    max-width: 4px !important;
    padding: 0 !important;
    background: var(--bg-secondary) !important;
    border-left: 1px solid var(--border-color) !important;
    border-right: 1px solid var(--border-color) !important;
}

/* Responsive */
@media (max-width: 768px) {
    /* Page Header */
    .plan-page-header {
        padding: 16px;
        margin-bottom: 16px;
    }

    .plan-header-icon {
        width: 36px;
        height: 36px;
    }

    .plan-page-header h1 {
        font-size: 1.25rem;
    }

    .plan-page-header p {
        font-size: 0.6875rem;
    }

    /* Account Controls */
    .account-select {
        font-size: 0.75rem;
        padding: 6px 28px 6px 10px;
    }

    .account-number-input {
        width: 100px;
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .icon-action-btn {
        width: 32px;
        height: 32px;
    }

    .header-divider {
        height: 20px;
        margin: 0 1px;
    }

    /* Summary Cards */
    .summary-card {
        padding: 12px 14px;
    }

    .summary-card__label {
        font-size: 0.625rem;
    }

    .summary-card__value {
        font-size: 1.125rem;
    }

    /* Settings Panel */
    .settings-panel .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .settings-label {
        font-size: 0.625rem;
        margin-bottom: 4px;
    }

    .form-input {
        padding: 8px 12px;
        font-size: 0.875rem;
    }

    /* Plan Table */
    .plan-th, .plan-td {
        padding: 8px 4px;
        font-size: 0.6875rem;
    }

    .plan-th-group {
        padding: 8px 4px;
        font-size: 0.625rem;
    }

    .plan-th-sub {
        padding: 6px 4px;
        font-size: 0.625rem;
    }

    .editable-cell {
        width: 56px;
        font-size: 0.6875rem;
        padding: 6px 4px;
    }

    .note-input {
        width: 70px;
    }

    /* Action Buttons */
    .icon-btn {
        width: 30px;
        height: 30px;
    }

    .icon-btn__icon {
        width: 16px;
        height: 16px;
    }

    .icon-btn__label {
        font-size: 0.625rem;
    }

    /* Today Marker */
    .today-marker {
        left: -46px;
        font-size: 0.5rem;
        padding: 3px 6px;
    }

    /* Save Changes Bar */
    .save-changes-bar {
        margin-top: 12px;
    }

    .save-all-btn {
        padding: 8px 20px;
        font-size: 0.75rem;
    }

    .change-count-badge {
        font-size: 0.6875rem;
        padding: 5px 12px;
    }

    /* Instructions Card */
    .instructions-card {
        padding: 14px;
        margin-top: 16px;
    }

    .instructions-card h3 {
        font-size: 0.8125rem;
    }

    .instructions-card ul {
        font-size: 0.6875rem;
    }

    /* Dialogs */
    .add-account-dialog {
        width: 95%;
        padding: 20px;
    }

    .dialog-title {
        font-size: 1rem;
    }

    .dialog-description {
        font-size: 0.75rem;
    }

    .inline-input-group .inline-label {
        padding: 0 10px;
        font-size: 0.75rem;
        height: 40px;
    }

    .inline-input-group .dialog-input {
        padding: 0 10px;
        height: 40px;
        font-size: 0.8125rem;
    }

    .dialog-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    /* Confirm Dialog */
    .confirm-dialog {
        width: 95%;
        padding: 20px;
    }

    .confirm-dialog__title {
        font-size: 1rem;
    }

    .confirm-dialog__text {
        font-size: 0.75rem;
    }

    .confirm-dialog__btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    /* Loading Panel */
    .loading-panel {
        min-height: 300px;
    }

    .loading-spinner {
        width: 32px;
        height: 32px;
    }

    .loading-text {
        font-size: 0.875rem;
    }

    .loading-subtext {
        font-size: 0.75rem;
    }

    /* Settings Toggle Bar */
    .settings-toggle-bar {
        height: 32px;
    }

    .settings-toggle-bar span {
        font-size: 0.6875rem;
    }

    /* Settings Panel */
    .settings-panel {
        max-height: 500px;
    }

    .settings-panel.open {
        max-height: 500px !important;
    }

    /* Table Scroll */
    .plan-table-scroll {
        max-height: calc(40px * 12 + 60px);
    }

    /* Sticky Headers */
    .plan-table thead tr:nth-child(2) th {
        top: 32px;
    }

    /* No Account CTA */
    #noAccountPlanCtaWrap {
        padding: 24px 0 8px;
    }

    #noAccountPlanCtaWrap a {
        padding: 10px 24px;
        font-size: 0.875rem;
        min-width: 160px;
    }


    /* Instructions Popup */
    .instructions-popup {
        padding: 20px;
        max-width: 95%;
    }

    .instructions-popup__header h3 {
        font-size: 0.9375rem;
    }

    .instructions-popup ul li {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* Extra Small Screens */
    .plan-page-header {
        padding: 12px;
    }

    .plan-header-icon {
        width: 32px;
        height: 32px;
    }

    .plan-page-header h1 {
        font-size: 1.125rem;
    }

    .account-select {
        font-size: 0.6875rem;
        padding: 5px 24px 5px 8px;
    }

    .account-number-input {
        width: 85px;
        font-size: 0.6875rem;
        padding: 5px 8px;
    }

    .icon-action-btn {
        width: 30px;
        height: 30px;
    }

    .summary-card {
        padding: 10px 12px;
    }

    .summary-card__value {
        font-size: 1rem;
    }

    .plan-th, .plan-td {
        padding: 6px 3px;
        font-size: 0.625rem;
    }

    .plan-th-group {
        font-size: 0.5625rem;
        padding: 6px 3px;
    }

    .plan-th-sub {
        font-size: 0.5625rem;
        padding: 5px 3px;
    }

    .editable-cell {
        width: 52px;
        font-size: 0.625rem;
        padding: 5px 3px;
    }

    .note-input {
        width: 60px;
    }

    .icon-btn {
        width: 28px;
        height: 28px;
    }

    .icon-btn__icon {
        width: 14px;
        height: 14px;
    }

    .today-marker {
        left: -40px;
        font-size: 0.4375rem;
        padding: 2px 5px;
    }

    .add-account-dialog {
        padding: 16px;
    }

    .dialog-title {
        font-size: 0.9375rem;
    }

    .dialog-description {
        font-size: 0.6875rem;
    }

    .inline-input-group .inline-label {
        padding: 0 8px;
        font-size: 0.6875rem;
        height: 38px;
    }

    .inline-input-group .dialog-input {
        padding: 0 8px;
        height: 38px;
        font-size: 0.75rem;
    }

    .dialog-btn {
        padding: 7px 14px;
        font-size: 0.6875rem;
    }

    #noAccountPlanCtaWrap {
        padding: 20px 0 8px;
    }

    #noAccountPlanCtaWrap a {
        padding: 9px 20px;
        font-size: 0.8125rem;
        min-width: 150px;
    }


    /* Instructions Popup */
    .instructions-popup {
        padding: 16px;
    }

    .instructions-popup__header h3 {
        font-size: 0.875rem;
    }

    .instructions-popup ul li {
        font-size: 0.6875rem;
        padding-left: 16px;
    }

    .instructions-popup ul li::before {
        width: 5px;
        height: 5px;
        top: 10px;
    }
}
