/* Custom styles for Excel upload page */
:root { --brand: #1c542f; --brand-dark: #143d21; }

/* ─── Page Loader ─── */
#page-loader {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 264px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#page-loader.page-loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid #e9ecef;
    border-top-color: #1c542f;
    border-radius: 50%;
    animation: page-loader-spin 0.7s linear infinite;
}

@keyframes page-loader-spin {
    to { transform: rotate(360deg); }
}

/* Enhanced card styling */
.card {
    transition: all 0.3s ease;
    border-radius: 16px !important;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

/* ─── Full-Color Primary Metric Cards ─── */
.card-metric {
    border-radius: 18px !important;
    color: white;
    overflow: hidden;
    position: relative;
}

.card-metric::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.card-metric-primary  { background: linear-gradient(135deg, #1c542f 0%, #143d21 100%); }
.card-metric-success  { background: linear-gradient(135deg, #28a745 0%, #1a7a32 100%); }
.card-metric-danger   { background: linear-gradient(135deg, #e74c3c 0%, #b22222 100%); }
.card-metric-info     { background: linear-gradient(135deg, #17a2b8 0%, #0e6e7e 100%); }
.card-metric-warning  { background: linear-gradient(135deg, #f39c12 0%, #c07000 100%); }

.card-title-metric {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.metric-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.metric-icon svg { color: white; width: 20px; height: 20px; }

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 4px 0;
    line-height: 1.1;
}

.metric-value .format-indian,
.metric-value .format-number {
    color: white !important;
    font-weight: 700;
}

.metric-sub {
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
}

/* ─── Cheque Summary Cards ─── */
.card-cheque {
    border-radius: 14px !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: white;
}

.card-cheque:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}

.card-cheque-blue   { background: linear-gradient(135deg, #1c542f 0%, #143d21 100%); }
.card-cheque-green  { background: linear-gradient(135deg, #28a745 0%, #1a6b2e 100%); }
.card-cheque-red    { background: linear-gradient(135deg, #e74c3c 0%, #9b1c1c 100%); }
.card-cheque-teal   { background: linear-gradient(135deg, #20c997 0%, #0a7a5a 100%); }
.card-cheque-purple { background: linear-gradient(135deg, #6f42c1 0%, #4a1f8a 100%); }
.card-cheque-orange { background: linear-gradient(135deg, #fd7e14 0%, #b84d00 100%); }
.card-cheque-gray   { background: linear-gradient(135deg, #6c757d 0%, #3d4349 100%); }

.cheque-icon svg { width: 22px; height: 22px; color: rgba(255,255,255,0.85); }

.cheque-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.cheque-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 2px;
}

/* File input styling */
.file-input {
    cursor: pointer;
}

.file-name {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
}

/* Progress bar enhancement */
.progress {
    background-color: #f0f0f0;
}

.progress-bar {
    background: linear-gradient(90deg, #1c542f, #2d7a4a);
}

/* Alert styling */
.alert-icon {
    display: inline-block;
    margin-right: 10px;
}

/* Upload results cards */
#uploadResults .card {
    animation: fadeIn 0.5s ease-out;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .col-md-4 {
        margin-bottom: 1rem;
    }
}

/* Clean Professional Styles */
.stat {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
}

.bg-orange {
    background-color: #ff9800 !important;
}





/* Risk Flags */
.risk-flag {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flag-safe {
    background: #4CAF50;
    color: white;
}

.flag-restrictbuy {
    background: #FFC107;
    color: #333;
}

.flag-margincall {
    background: #FF9800;
    color: white;
}

.flag-forcesell {
    background: #FF5722;
    color: white;
}

.flag-default {
    background: #F44336;
    color: white;
}

.flag-zerocollateral {
    background: #9E9E9E;
    color: white;
}

.flag-na {
    background: #E0E0E0;
    color: #666;
}




.balance-type-dr {
    color: #f44336;
    font-weight: 500;
}

.balance-type-cr {
    color: #4CAF50;
    font-weight: 500;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

.table-note {
    margin-top: 1rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}


/* Number Formatting Styles */
.format-number,
.format-indian,
.format-intl {
    font-weight: 600;
    color: #2c7a7b;
    transition: all 0.2s ease;
}

.format-number:hover,
.format-indian:hover,
.format-intl:hover {
    color: #38b2ac;
    transform: scale(1.05);
}

/* Negative value styling */
.negative .format-indian,
.negative .format-number {
    color: #f44336;
}

.positive .format-indian,
.positive .format-number {
    color: #4CAF50;
}

/* Dashboard clickable counts */
.card-body h3 a {
    transition: all 0.2s ease;
}

.card-body h3 a:hover {
    color: #1c542f !important;
    transform: scale(1.05);
    display: inline-block;
}

/* Make clickable counts more obvious on hover */
.card-body h3 a.format-number:hover::after {
    content: ' →';
    font-size: 0.9em;
    margin-left: 5px;
}

/* ─── Performer Rows (Top Agents / Top Groups) ─── */
.performer-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    transition: background 0.15s ease;
    color: inherit;
}

.performer-row:hover {
    background: #f4f7fc;
}

.performer-row-border {
    border-bottom: 1px solid #f0f2f5;
}

.performer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
}

.performer-avatar-primary { background: linear-gradient(135deg, #1c542f, #143d21); }
.performer-avatar-success  { background: linear-gradient(135deg, #28a745, #1a7a32); }

.performer-info {
    flex: 1;
    min-width: 0;
    margin: 0 12px;
}

.performer-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.performer-meta {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 1px;
}

.performer-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1c542f;
    text-align: right;
    flex-shrink: 0;
}

.performer-amount .format-indian {
    color: #1c542f !important;
}

/* ─── Dashboard Tables ─── */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dash-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e9ecef;
}

.dash-table thead th {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
    white-space: nowrap;
    border: none;
}

.dash-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.12s ease;
}

.dash-table tbody tr:last-child {
    border-bottom: none;
}

.dash-table tbody tr:hover {
    background: #f4f7fc;
}

.dash-table tbody td {
    padding: 10px 14px;
    border: none;
    vertical-align: middle;
    color: #2c3e50;
}

.dash-th-num, .dash-td-num {
    width: 36px;
    color: #adb5bd;
    font-weight: 600;
    font-size: 0.75rem;
}

.dash-td-meta {
    color: #6c757d;
    font-size: 0.8rem;
}

.dash-td-empty {
    text-align: center;
    color: #adb5bd;
    padding: 24px !important;
    font-style: italic;
}

.dash-client-link {
    color: #2c3e50;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.dash-client-link:hover {
    color: #1c542f;
}

.dash-client-link.text-danger:hover {
    color: #c0392b !important;
}

/* ─── View All links & count chips ─── */
.dash-view-all {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1c542f;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid #1c542f;
    border-radius: 20px;
    transition: all 0.15s;
}

.dash-view-all:hover {
    background: #1c542f;
    color: white;
}

.dash-view-all-success        { color: #28a745; border-color: #28a745; }
.dash-view-all-success:hover  { background: #28a745; color: white; }

.dash-view-all-info           { color: #17a2b8; border-color: #17a2b8; }
.dash-view-all-info:hover     { background: #17a2b8; color: white; }

.dash-count-chip {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    background: #e9ecef;
    padding: 3px 10px;
    border-radius: 20px;
}

/* ─── Global Table Styles (applies everywhere not overridden) ─── */
.table {
    border-collapse: collapse;
    font-size: 0.85rem;
    width: 100%;
}

.table thead tr {
    background: #f8fafc;
}

.table thead th {
    background: #f8fafc;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 14px;
    border-bottom: 2px solid #e9ecef;
    border-top: none;
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.12s ease;
}

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

.table tbody tr:hover {
    background-color: #f4f7fc;
}

.table tbody td {
    padding: 10px 14px;
    border-top: none;
    border-bottom: none;
    vertical-align: middle;
    color: #2c3e50;
}

.table-sm thead th {
    padding: 8px 12px;
}

.table-sm tbody td {
    padding: 8px 12px;
}

/* Card header consistency */
.card-header {
    border-bottom: 1px solid #f0f2f5;
    background: transparent;
}

/* ─── Sidebar Brand Color Overrides ─── */
/* Active/hover colors are set dynamically via inline style in sidebar.html using brand_color */

