/* =============================================
   DAILY SUMMARY REPORT STYLES
   Prefix: isr- (Invoicing Summary Report)
   Dark theme matching tickets-admin pattern
   ============================================= */

/* Main Wrapper */
.isr-wrapper {
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
}

/* =============================================
   LOADING OVERLAY
   ============================================= */

.isr-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.isr-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--chrome-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: isr-spin 0.7s linear infinite;
}

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

/* =============================================
   TOOLBAR — Dark bar matching ta-toolbar
   ============================================= */

.isr-toolbar {
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-border);
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.isr-toolbar-left {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.isr-toolbar-right {
    display: flex;
    gap: 4px;
    align-items: center;
}

.isr-toolbar-separator {
    width: 1px;
    height: 22px;
    background: var(--chrome-active);
    margin: 0 4px;
    flex-shrink: 0;
}

/* Toggle Group — Date Out / Invoice Date */
.isr-toggle-group {
    display: flex;
    gap: 2px;
    background: var(--chrome-hover);
    border-radius: 4px;
    padding: 2px;
}

.isr-toggle {
    background: transparent;
    color: var(--chrome-text);
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 4px 10px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.15s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.isr-toggle i {
    font-size: 11px;
    opacity: 0.6;
}

.isr-toggle:hover {
    color: var(--chrome-text);
    background: var(--chrome-hover);
}

.isr-toggle.active {
    background: var(--accent-primary);
    color: var(--text-primary);
    border-color: var(--accent-primary);
    font-weight: 700;
}

.isr-toggle.active i {
    color: var(--text-primary);
    opacity: 1;
}

/* Toolbar Fields */
.isr-toolbar-field {
    display: flex;
    align-items: center;
    gap: 4px;
}

.isr-toolbar-field label {
    font-size: 10px;
    font-weight: 600;
    color: var(--chrome-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.isr-toolbar-field input[type="date"],
.isr-toolbar-field input[type="time"],
.isr-toolbar-field select {
    background: var(--chrome-hover);
    color: var(--chrome-text);
    border: 1px solid var(--chrome-border);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 11px;
    font-family: var(--font-sans);
    transition: all 0.15s ease;
    height: 28px;
    line-height: 1;
    color-scheme: dark;
}

.isr-toolbar-field input[type="date"]::-webkit-calendar-picker-indicator,
.isr-toolbar-field input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.isr-toolbar-field input[type="date"]::-webkit-calendar-picker-indicator:hover,
.isr-toolbar-field input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.isr-toolbar-field select {
    cursor: pointer;
    padding-right: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.isr-toolbar-field input:focus,
.isr-toolbar-field select:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--chrome-active);
}

.isr-time-field {
    max-width: 90px;
}

/* Checkbox — custom styled toggle */
.isr-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--chrome-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--chrome-border);
    background: var(--chrome-hover);
    transition: all 0.15s ease;
    height: 28px;
}

.isr-check:hover {
    background: var(--chrome-hover);
    border-color: var(--chrome-border);
}

.isr-check input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--chrome-border);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.isr-check input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.isr-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Buttons */
.isr-btn {
    background: var(--chrome-hover);
    color: var(--chrome-text);
    border: 1px solid var(--chrome-border);
    border-radius: 4px;
    padding: 5px 11px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.12s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.isr-btn i {
    font-size: 11px;
    opacity: 0.75;
}

.isr-btn:hover {
    background: var(--chrome-active);
    border-color: var(--chrome-border);
}

.isr-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.isr-btn-green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}

.isr-btn-green:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.4);
}

.isr-btn-back {
    background: var(--chrome-hover);
    color: var(--chrome-text);
    border-color: var(--chrome-border);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.isr-btn-back:hover {
    background: var(--chrome-active);
    color: var(--chrome-text);
    border-color: var(--chrome-border);
}

/* =============================================
   CONTENT AREA
   ============================================= */

.isr-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.isr-content::-webkit-scrollbar {
    width: 4px;
}

.isr-content::-webkit-scrollbar-track {
    background: transparent;
}

.isr-content::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

/* =============================================
   STATS ROW
   ============================================= */

.isr-stats {
    display: flex;
    gap: 1px;
    background: var(--border-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

.isr-stat {
    flex: 1;
    background: var(--surface);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.isr-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.isr-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.isr-text-green {
    color: #059669 !important;
}

.isr-text-red {
    color: var(--error) !important;
}

.isr-text-amber {
    color: var(--accent-secondary) !important;
}

/* =============================================
   PANELS
   ============================================= */

.isr-panel {
    background: var(--surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.isr-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--surface-inset, var(--bg-secondary));
}

.isr-panel-header > span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.isr-panel-header > span i {
    color: var(--accent-primary);
    font-size: 14px;
}

/* Search */
.isr-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.isr-search-icon {
    position: absolute;
    left: 8px;
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

.isr-search {
    padding: 5px 10px 5px 26px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    font-size: 12px;
    width: 200px;
    background: var(--surface);
    color: var(--text-body);
    transition: all 0.15s ease;
}

.isr-search:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

/* =============================================
   TABLES
   ============================================= */

.isr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.isr-table thead tr {
    border-bottom: 1px solid var(--border-primary);
}

.isr-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    user-select: none;
    white-space: nowrap;
}

.isr-table th.sortable {
    cursor: pointer;
    transition: color 0.15s;
}

.isr-table th.sortable:hover {
    color: var(--accent-primary);
}

.isr-table th i {
    margin-left: 4px;
    font-size: 9px;
}

.isr-table th.align-right,
.isr-table td.align-right {
    text-align: right;
}

.isr-table th.align-center,
.isr-table td.align-center {
    text-align: center;
}

.isr-table tbody tr {
    border-bottom: 1px solid var(--border-secondary, rgba(255,255,255,0.04));
    transition: background 0.1s;
}

.isr-table tbody tr:hover {
    background: var(--bg-secondary, rgba(255,255,255,0.02));
}

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

.isr-table td {
    padding: 8px 12px;
    color: var(--text-body);
}

.isr-table td.mono {
    font-variant-numeric: tabular-nums;
}

/* =============================================
   EMPTY STATE
   ============================================= */

.isr-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
}

.isr-empty-state i {
    font-size: 32px;
    opacity: 0.4;
}

.isr-empty-state p {
    font-size: 13px;
    margin: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
    .isr-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }

    .isr-toolbar-left,
    .isr-toolbar-right {
        flex-wrap: wrap;
    }

    .isr-stats {
        flex-wrap: wrap;
    }

    .isr-stat {
        min-width: calc(33% - 1px);
    }
}

@media (max-width: 768px) {
    .isr-stats {
        flex-direction: column;
    }

    .isr-stat {
        min-width: 100%;
    }

    .isr-search {
        width: 100%;
    }

    .isr-panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}
