/* Guardfolio Trading Journal Styles - Light Theme & Premium UI */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Urbanist:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

:root {
    --gtj-bg-dark: #f9fafb;
    /* Main Background (Very Light Grey) */
    --gtj-bg-card: #ffffff;
    /* Card Background (White) */
    --gtj-bg-sidebar: #ffffff;
    /* Sidebar Background (White) */
    --gtj-text-primary: #111827;
    /* Dark Text */
    --gtj-text-secondary: #6b7280;
    /* Grey Text */
    --gtj-accent: #FF6523;
    /* Guardfolio Orange */
    --gtj-accent-hover: #e55a1f;
    --gtj-border: #e5e7eb;
    --gtj-success: #10b981;
    --gtj-danger: #ef4444;
    --gtj-warning: #f59e0b;
    --gtj-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --gtj-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.guardfolio-app {
    display: flex;
    font-family: 'Inter', sans-serif;
    background-color: var(--gtj-bg-dark);
    color: var(--gtj-text-primary);
    min-height: 800px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--gtj-shadow);
    border: 1px solid var(--gtj-border);
}

/* Sidebar */
.guardfolio-sidebar {
    width: 260px;
    min-width: 260px;
    /* Prevent shrinking */
    flex-shrink: 0;
    /* Prevent flex shrinking */
    background-color: var(--gtj-bg-sidebar);
    border-right: 1px solid var(--gtj-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.guardfolio-logo {
    font-family: 'Urbanist', sans-serif;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--gtj-text-primary);
    letter-spacing: -0.5px;
}

.guardfolio-nav {
    margin-top: 20px;
}

.guardfolio-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--gtj-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
}

.guardfolio-nav a:hover,
.guardfolio-nav a.active {
    background-color: rgba(255, 101, 35, 0.08);
    color: var(--gtj-accent);
}

.guardfolio-nav a span.dashicons {
    margin-right: 12px;
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guardfolio-badge {
    background-color: var(--gtj-accent);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.guardfolio-btn-primary.full-width {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    padding: 12px;
    font-size: 15px;
    box-shadow: 0 4px 6px rgba(255, 101, 35, 0.2);
}

.guardfolio-btn-primary {
    background-color: var(--gtj-accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Urbanist', sans-serif;
    transition: background-color 0.2s;
}

.guardfolio-btn-primary:hover {
    background-color: var(--gtj-accent-hover);
}

/* Main Content */
.guardfolio-main {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.guardfolio-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.guardfolio-breadcrumbs {
    font-size: 24px;
    font-weight: 700;
    color: var(--gtj-text-primary);
    letter-spacing: -0.5px;
}

.guardfolio-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guardfolio-user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--gtj-border);
}

.guardfolio-filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.guardfolio-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    background-color: var(--gtj-bg-card);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--gtj-border);
    box-shadow: var(--gtj-shadow);
}

.guardfolio-filter-select,
.guardfolio-filter-date {
    padding: 8px 12px;
    border: 1px solid var(--gtj-border);
    border-radius: 6px;
    background-color: #f9fafb;
    color: var(--gtj-text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.guardfolio-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f9fafb;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--gtj-border);
}

.guardfolio-date-range input {
    border: none;
    background: transparent;
    font-size: 13px;
    width: 110px;
}

.guardfolio-btn-secondary {
    padding: 8px 16px;
    background-color: #f3f4f6;
    border: 1px solid var(--gtj-border);
    border-radius: 6px;
    color: var(--gtj-text-primary);
    cursor: pointer;
    font-weight: 500;
}

.guardfolio-btn-secondary:hover {
    background-color: #e5e7eb;
}

/* KPI Cards */
.guardfolio-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.guardfolio-kpi-card {
    background-color: var(--gtj-bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--gtj-border);
    box-shadow: var(--gtj-shadow);
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 13px;
    color: var(--gtj-text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gtj-text-primary);
    margin: 0 0 4px 0;
    font-family: 'Urbanist', sans-serif;
}

.kpi-sub {
    font-size: 12px;
    color: var(--gtj-success);
    font-weight: 500;
}

.kpi-progress {
    height: 4px;
    background-color: #f3f4f6;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.kpi-progress div {
    height: 100%;
    background-color: var(--gtj-accent);
    border-radius: 2px;
}

/* Dashboard Grid */
.guardfolio-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.guardfolio-widget {
    background-color: var(--gtj-bg-card);
    border-radius: 12px;
    border: 1px solid var(--gtj-border);
    box-shadow: var(--gtj-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gtj-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gtj-text-primary);
}

.widget-body {
    padding: 20px;
    flex: 1;
}

.widget-body.no-padding {
    padding: 0;
}

.widget-body.centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Circle Chart Large */
.guardfolio-circle-chart.large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 10px solid #f3f4f6;
    border-top-color: var(--gtj-success);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.guardfolio-circle-chart.large span {
    font-size: 32px;
    font-weight: 700;
    color: var(--gtj-text-primary);
}

.guardfolio-circle-chart.large small {
    font-size: 14px;
    color: var(--gtj-text-secondary);
}

/* Table */
.guardfolio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.guardfolio-table th {
    background-color: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--gtj-border);
    color: var(--gtj-text-secondary);
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.open {
    background-color: var(--gtj-accent);
}

.status-dot.closed {
    background-color: var(--gtj-text-secondary);
}

.view-all-link {
    font-size: 13px;
    color: var(--gtj-accent);
    text-decoration: none;
    font-weight: 500;
}

/* Modal (Premium Design) */
.guardfolio-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(17, 24, 39, 0.6);
    /* Darker overlay */
    backdrop-filter: blur(4px);
}

.guardfolio-modal-content {
    background-color: var(--gtj-bg-card);
    margin: 5% auto;
    padding: 40px;
    border: 1px solid var(--gtj-border);
    width: 90%;
    max-width: 550px;
    border-radius: 16px;
    box-shadow: var(--gtj-shadow-lg);
    position: relative;
    font-family: 'Inter', sans-serif;
    animation: modalSlideIn 0.3s ease-out;
}

.guardfolio-modal-content h3 {
    margin-top: 0;
    font-family: 'Urbanist', sans-serif;
    color: var(--gtj-text-primary);
    margin-bottom: 32px;
    font-size: 24px;
    text-align: center;
}

.guardfolio-form-group {
    margin-bottom: 20px;
}

.guardfolio-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.guardfolio-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95em;
    color: var(--gtj-text-primary);
}

.guardfolio-form-group input,
.guardfolio-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gtj-border);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    background-color: #f9fafb;
    color: var(--gtj-text-primary);
    transition: all 0.2s;
    box-sizing: border-box;
}

.guardfolio-form-group input:focus,
.guardfolio-form-group select:focus {
    outline: none;
    border-color: var(--gtj-accent);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 101, 35, 0.1);
}

.guardfolio-submit-btn {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    font-size: 16px;
    background-color: var(--gtj-accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.fc-button-primary:hover {
    background-color: #f9fafb !important;
    color: var(--gtj-text-primary) !important;
}

.fc-button-primary.fc-button-active {
    background-color: var(--gtj-accent) !important;
    border-color: var(--gtj-accent) !important;
    color: #fff !important;
}

.guardfolio-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gtj-border);
    color: var(--gtj-text-primary);
}

.guardfolio-table tr:last-child td {
    border-bottom: none;
}

.badge-long {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--gtj-success);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.badge-short {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--gtj-danger);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
}

.text-green {
    color: var(--gtj-success);
    font-weight: 600;
}

.text-red {
    color: var(--gtj-danger);
    font-weight: 600;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.guardfolio-close {
    color: var(--gtj-text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 24px;
    top: 20px;
    transition: color 0.2s;
}

.guardfolio-close:hover {
    color: var(--gtj-text-primary);
}

.fc-event-pnl {
    font-weight: 700;
    font-size: 13px;
}

.fc-event-trades {
    font-size: 11px;
    opacity: 0.9;
}

.fc-event-badge {
    background-color: #3b82f6;
    /* Blue */
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
    font-weight: 600;
    margin-top: 4px;
}

.fc-event-icons {
    margin-top: auto;
    display: flex;
    gap: 6px;
    font-size: 12px;
    opacity: 0.8;
}

.fc-event-icons span {
    display: flex;
    align-items: center;
    gap: 2px;
}

.fc-toolbar-title {
    font-family: 'Urbanist', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.5em !important;
    color: var(--gtj-text-primary);
}

.fc-col-header-cell-cushion {
    color: var(--gtj-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    padding: 10px 0 !important;
}

.fc-daygrid-day-number {
    font-weight: 500;
    color: var(--gtj-text-secondary);
    font-size: 14px;
    margin: 4px;
}

.fc-daygrid-day.fc-day-today {
    background-color: rgba(255, 101, 35, 0.03) !important;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--gtj-border) !important;
}

.fc-scrollgrid {
    border: none !important;
}

.fc-scrollgrid-section-header td {
    border-bottom: 2px solid var(--gtj-border) !important;
}

.fc-daygrid-day-top {
    flex-direction: row;
}

.fc-day-other .fc-daygrid-day-top {
    opacity: 0.3;
}

.guardfolio-month-stats-container {
    padding: 24px 32px;
    border-top: 1px solid var(--gtj-border);
}

.guardfolio-month-stats-container h3 {
    font-family: 'Urbanist', sans-serif;
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--gtj-text-primary);
}

.guardfolio-stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.stat-card-detailed {
    background: var(--gtj-bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--gtj-border);
    box-shadow: var(--gtj-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
}

.stat-card-detailed .stat-label {
    font-size: 13px;
    color: var(--gtj-text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-card-detailed h4 {
    font-size: 24px;
    margin: 12px 0 4px 0;
    color: var(--gtj-text-primary);
    font-family: 'Urbanist', sans-serif;
}

.stat-card-detailed .stat-sub {
    font-size: 12px;
    color: var(--gtj-text-secondary);
}

.stat-badges {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.badge-green {
    background-color: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.badge-red {
    background-color: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .guardfolio-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .guardfolio-stats-grid,
    .guardfolio-stats-grid-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .guardfolio-stats-grid-detailed {
        grid-template-columns: 1fr;
    }
}

/* Spreadsheet Mode */
.guardfolio-table.spreadsheet-mode {
    font-size: 13px;
    border: 1px solid #d1d5db;
}

.guardfolio-table.spreadsheet-mode th {
    background-color: #4b5563;
    color: white;
    padding: 6px 8px;
    border: 1px solid #9ca3af;
    font-weight: 600;
}

.guardfolio-table.spreadsheet-mode td {
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}

.guardfolio-table.spreadsheet-mode tr:nth-child(even) {
    background-color: #f3f4f6;
}

.guardfolio-table.spreadsheet-mode tr:hover {
    background-color: #e5e7eb;
}

.guardfolio-table.spreadsheet-mode .text-right {
    text-align: right;
}

.guardfolio-table.spreadsheet-mode .text-center {
    text-align: center;
}

/* Edit and Delete Icon Buttons */
.btn-icon {
    background-color: #e5e7eb;
    /* Light gray */
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 4px;
    font-size: 14px;
}

.btn-icon:last-child {
    margin-right: 0;
}

.btn-icon .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.btn-icon:hover {
    background-color: #d1d5db;
    /* Darker gray on hover */
    transform: translateY(-1px);
}

.btn-edit:hover {
    background-color: #dbeafe;
    /* Light blue on hover */
    color: #3b82f6;
}

.btn-delete:hover {
    background-color: #fee2e2;
    /* Light red on hover */
    color: #ef4444;
}

.btn-icon:active {
    transform: translateY(0);
}

.guardfolio-table .btn-icon {
    background-color: #e5e7eb !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    margin-right: 10px !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}

.guardfolio-table .btn-icon:last-child {
    margin-right: 0 !important;
}

.guardfolio-table .btn-icon .dashicons {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
}

.guardfolio-table .btn-icon:hover {
    background-color: #d1d5db !important;
    transform: translateY(-1px) !important;
}

.guardfolio-table .btn-edit:hover {
    background-color: #dbeafe !important;
    color: #3b82f6 !important;
}

.guardfolio-table .btn-delete:hover {
    background-color: #fee2e2 !important;
    color: #ef4444 !important;
}

.guardfolio-table .btn-icon:active {
    transform: translateY(0) !important;
}

/* Trade Count Badge (for Open Trades header) */
.trade-count-badge {
    background-color: var(--gtj-accent);
    color: white;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 10px;
    vertical-align: middle;
}

/* Close Trade Button (Checkmark) */
.btn-close-trade {
    background-color: transparent !important;
    color: var(--gtj-text-secondary) !important;
    padding: 6px !important;
    border: 1px solid var(--gtj-border) !important;
}

.btn-close-trade:hover {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: var(--gtj-success) !important;
}

/* ===============================================
   MODAL STYLES - Clean & Minimal
   =============================================== */

.guardfolio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.guardfolio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.guardfolio-modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 640px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.guardfolio-modal-header {
    padding: 32px 32px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guardfolio-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--gtj-text-primary);
}

.guardfolio-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--gtj-text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.guardfolio-modal-close:hover {
    background: var(--gtj-bg-dark);
    color: var(--gtj-text-primary);
}

/* Modal Section - Very Subtle */
.guardfolio-modal-section {
    padding: 0;
    margin-bottom: 24px;
}

.guardfolio-modal-section .section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gtj-text-secondary);
    margin: 0 0 12px 0;
    padding: 0;
}

/* Exit Section - Highlight Editable */
.exit-section {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 8px;
    margin-top: 8px;
}

.exit-section .section-title {
    color: #10b981;
}

/* Form Container */
#edit-trade-form,
#close-trade-form {
    padding: 32px;
}

/* Form Row */
.guardfolio-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.guardfolio-form-group {
    margin-bottom: 16px;
}

.guardfolio-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gtj-text-primary);
    margin-bottom: 8px;
}

.guardfolio-form-group input,
.guardfolio-form-group select {
    padding: 12px 14px;
    border: 1px solid var(--gtj-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--gtj-text-primary);
    background: white;
    transition: all 0.2s;
}

.guardfolio-form-group input:focus,
.guardfolio-form-group select:focus {
    outline: none;
    border-color: var(--gtj-accent);
    box-shadow: 0 0 0 3px rgba(255, 101, 35, 0.1);
}

.guardfolio-form-group input:read-only,
.guardfolio-form-group input[readonly] {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
    cursor: default;
}

.guardfolio-form-group select:disabled {
    background: var(--gtj-bg-dark);
    color: var(--gtj-text-secondary);
    cursor: not-allowed;
}

/* Form Actions */
.guardfolio-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--gtj-border);
    margin-top: 32px;
}

.guardfolio-btn,
.guardfolio-btn-secondary {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.guardfolio-btn {
    background: var(--gtj-accent);
    color: white;
}

.guardfolio-btn:hover {
    background: var(--gtj-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(255, 101, 35, 0.2);
}

.guardfolio-btn-secondary {
    background: white;
    color: var(--gtj-text-primary);
    border: 1px solid var(--gtj-border);
}

.guardfolio-btn-secondary:hover {
    background: var(--gtj-bg-dark);
}

/* 3-Column Layout for Forms */
.guardfolio-form-row.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .guardfolio-form-row.three-col {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    /* Monthly Stats Grid - Detailed Layout */
    .guardfolio-stats-grid-detailed {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-top: 20px;
        width: 100%;
        box-sizing: border-box;
        padding-right: 2px;
        /* Prevent Scrollbar overlap if any */
    }

    /* Ensure cards don't overflow */
    .stat-card-detailed {
        background: #fff;
        padding: 16px;
        border-radius: 8px;
        border: 1px solid var(--gtj-border);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        min-width: 0;
        /* Flex/Grid min-width fix */
    }

    @media (max-width: 1200px) {
        .guardfolio-stats-grid-detailed {
            grid-template-columns: repeat(2, 1fr);
        }
    }
}

/* =========================================
   RESPONSIVE MOBILE STYLES
   ========================================= */

@media (max-width: 1024px) {
    .guardfolio-app {
        flex-direction: column;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .guardfolio-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gtj-border);
        padding: 16px;
        box-sizing: border-box;
    }

    .guardfolio-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        margin-top: 10px;
        padding-bottom: 4px;
        /* Scrollbar space */
    }

    .guardfolio-nav a {
        white-space: nowrap;
        margin-bottom: 0;
        font-size: 13px;
        padding: 8px 12px;
    }

    .guardfolio-logo {
        margin-bottom: 0;
        font-size: 20px;
    }

    .guardfolio-main {
        padding: 20px;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .guardfolio-stats-grid {
        grid-template-columns: 1fr;
    }

    .guardfolio-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .guardfolio-form-row {
        grid-template-columns: 1fr;
    }

    .guardfolio-form-row.three-col {
        grid-template-columns: 1fr;
    }

    .guardfolio-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .guardfolio-filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .guardfolio-filters {
        flex-wrap: wrap;
    }

    .guardfolio-user-profile {
        margin-top: 10px;
    }

    /* Table Responsiveness */
    .guardfolio-table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        border: 1px solid var(--gtj-border);
        border-radius: 8px;
    }

    .guardfolio-table {
        min-width: 800px;
        /* Force scroll */
    }

    /* Adjust Modal */
    .guardfolio-modal-content {
        width: 95%;
        padding: 24px;
        margin: 10% auto;
    }

    .guardfolio-modal-header {
        padding: 20px 20px 10px;
    }

    #edit-trade-form {
        padding: 20px;
    }
}

/* Chart Controls in Widget Header */
.chart-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.chart-controls .btn-icon {
    background-color: transparent;
    border: 1px solid var(--gtj-border);
    color: var(--gtj-text-secondary);
}

.chart-controls .btn-icon:hover {
    background-color: #f3f4f6;
    color: var(--gtj-accent);
    border-color: var(--gtj-accent);
}

/* Force Chart.js canvas to fill the container height */
.widget-body canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Systemic Layout Fixes */
/* Automatically remove borders/shadows if inside a widget (Card) */
.guardfolio-widget .guardfolio-table-container {
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    background: transparent !important;
}

/* Calendar Widget Specifics */
/* Calendar Monthly Stats Container */
.guardfolio-month-stats-container {
    padding: 20px 32px 32px 32px;
    border-top: 1px solid #e5e7eb;
    /* Subtle separator from calendar */
    margin-top: 0;
}

/* NOW Button Styles */
.now-btn:hover {
    background: #f3f4f6 !important;
    border-color: #9ca3af !important;
    color: #374151 !important;
    transform: scale(1.05);
}

.now-btn:active {
    transform: scale(0.95) !important;
    background: #e5e7eb !important;
}