:root {
    --primary-color: #0099CC;
    --primary-hover: #00AADD;
    --primary-glow: rgba(0, 153, 204, 0.2);
    --secondary-color: rgba(0, 0, 0, 0.03);
    --secondary-hover: rgba(0, 0, 0, 0.05);

    --bg-color: #F0F6FF;
    --surface-color: rgba(255, 255, 255, 0.85);
    --surface-strong: rgba(245, 250, 255, 0.95);

    --text-main: #1A2E44;
    --text-muted: #7A99B8;
    --text-heading: #0D1E30;

    --border-color: rgba(0, 130, 200, 0.12);
    --border-active: rgba(0, 153, 204, 0.35);

    --danger-color: #E02050;
    --success-color: #00B884;
    --accent-purple: #7C3AED;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    --shadow-sm: 0 8px 32px rgba(0, 80, 160, 0.08);
    --shadow-md: 0 24px 80px rgba(0, 80, 160, 0.12);
}

/* ─── Reset ─────────────────────────────────────── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Body & Background ──────────────────────────── */
body {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient gradient blobs */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 15% 15%, rgba(0, 153, 204, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(124, 58, 237, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 184, 132, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle grid overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 130, 200, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 130, 200, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
    position: relative;
    z-index: 1;
}

/* ─── Sidebar ────────────────────────────────────── */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 200, 255, 0.3) 30%, rgba(139, 92, 246, 0.2) 70%, transparent 100%);
    pointer-events: none;
}

.logo {
    padding: 26px 22px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.02em;
}

.logo i {
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.18), rgba(139, 92, 246, 0.18));
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 200, 255, 0.22);
    box-shadow: 0 0 24px rgba(0, 200, 255, 0.18), inset 0 0 12px rgba(0, 200, 255, 0.06);
    filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.3));
}

.sidebar-nav-user {
    display: contents;
}

.nav-menu {
    padding: 18px 14px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 13px;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all 0.22s ease;
    background: transparent;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(0, 200, 255, 0.06);
    border-color: rgba(0, 200, 255, 0.1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.12), rgba(139, 92, 246, 0.07));
    color: var(--primary-color);
    border-color: rgba(0, 200, 255, 0.22);
    box-shadow: 0 4px 20px rgba(0, 200, 255, 0.1);
}

.nav-item.active i {
    filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.6));
}

.user-section {
    padding: 12px 14px 18px 14px;
    border-top: 1px solid var(--border-color);
}

.user-section #login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-md);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    background: rgba(0, 153, 204, 0.05);
    border: 1px solid rgba(0, 153, 204, 0.15);
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 0;
}

.user-info.hidden {
    display: none !important;
}

.user-email-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.user-email-group i {
    color: var(--primary-color);
    font-size: 0.95rem;
    flex-shrink: 0;
}

#user-email {
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

#logout-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: white;
    border: 1px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

#logout-btn:hover {
    color: var(--danger-color);
    border-color: rgba(224, 32, 80, 0.3);
    background: rgba(224, 32, 80, 0.06);
    transform: none;
}

/* ─── Main Content ───────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    min-height: 70px;
    padding: 15px 26px;
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top-header h1 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ─── Buttons ────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

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

.header-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    padding: 7px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.header-toggle-label:hover {
    border-color: var(--primary-color);
    background: #F0F8FF;
}

.header-toggle-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary-color);
    width: 15px;
    height: 15px;
    margin: 0;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover:not(:disabled) {
    background: #F8FAFC;
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: var(--success-color);
    color: white;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-success:hover:not(:disabled) {
    background: #00A375;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

.btn-google {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-google:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-icon:hover {
    color: var(--primary-color);
    background: rgba(0, 200, 255, 0.08);
}

.full-width { width: 100%; }
.mt-4 { margin-top: 16px; }

/* ─── Workspace Panels ───────────────────────────── */
.workspace {
    flex: 1;
    padding: 20px 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    min-height: 0;
}

.panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.45), transparent);
    pointer-events: none;
}

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

.panel-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* ─── Dictation Panel (Centered Minimalist Frame) ─── */
.dictation-panel {
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dictation-panel:hover {
    border-color: var(--border-active);
    box-shadow: 0 6px 20px rgba(0, 153, 204, 0.08);
}

.dictation-panel:has(.recording) {
    border-color: rgba(224, 32, 80, 0.35);
    box-shadow: 0 4px 20px rgba(224, 32, 80, 0.12);
}

.record-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0;
    text-align: center;
}

.record-btn {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EEF7FF 0%, #DCEEFF 100%);
    border: 1.5px solid rgba(0, 153, 204, 0.25);
    color: var(--primary-color);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 153, 204, 0.15);
}

.record-btn:hover:not(:disabled) {
    transform: scale(1.06);
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 153, 204, 0.25);
}

.record-btn:disabled,
.record-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #E2E8F0;
    border-color: #CBD5E1;
    color: #94A3B8;
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

.record-btn.recording {
    background: linear-gradient(135deg, #FFE4E8 0%, #FECDD3 100%);
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 0 4px rgba(224, 32, 80, 0.2);
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(224, 32, 80, 0.35); }
    70%  { box-shadow: 0 0 0 14px rgba(224, 32, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 32, 80, 0); }
}

.record-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    text-align: center;
}

.record-info-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.record-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.record-title i {
    color: var(--primary-color);
    font-size: 0.80rem;
}

.record-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #CBD5E1;
    transition: background 0.3s ease;
}

.record-btn.recording ~ .record-info .record-pulse-dot,
.dictation-panel:has(.recording) .record-pulse-dot {
    background: var(--danger-color);
    box-shadow: 0 0 8px rgba(224, 32, 80, 0.6);
    animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

#record-status {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

.report-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.text-area-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.text-area-wrapper label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 14px 16px;
    background: rgba(240, 248, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    outline: none;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.65;
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.55;
}

textarea:focus {
    border-color: rgba(0, 200, 255, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.07);
}


/* ─── Generating Report State ─────────────────────── */
.generating-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 280px;
    padding: 40px 20px;
}

.generating-spinner {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 153, 204, 0.12), rgba(139, 92, 246, 0.12));
    border: 2px solid rgba(0, 153, 204, 0.3);
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    box-shadow: 0 0 25px rgba(0, 153, 204, 0.18);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 18px rgba(0, 153, 204, 0.15);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 32px rgba(0, 153, 204, 0.35);
    }
}

.generating-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 8px 0;
}

.generating-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0;
}

/* ─── Report Panel ───────────────────────────────── */
.report-content {
    padding: 28px 30px;
    flex: 1;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.85;
    outline: none;
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-main);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin: 12px;
}

.report-content h1,
.report-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-heading);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.report-content h2,
#report-viewer-content h2 {
    font-size: 1.22rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

.report-content p,
.report-content ul {
    margin-bottom: 10px;
}

.report-meta-group {
    margin-bottom: 8px;
}

.report-meta-group p {
    margin-bottom: 2px !important;
}

.report-content hr,
#report-viewer-content hr,
.section-divider {
    display: block !important;
    border: none;
    border-top: 1.5px solid var(--border-color);
    margin: 14px 0 10px 0;
    padding: 0;
}

.doppler-section {
    margin-top: 8px;
    line-height: 1.75;
}

.placeholder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.45;
    text-align: center;
    gap: 14px;
}

.placeholder-state i {
    font-size: 42px;
    color: rgba(0, 200, 255, 0.2);
}

/* ─── Modal ──────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 30, 60, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 1;
    transition: opacity 0.22s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    width: 500px;
    max-width: 92vw;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md), 0 0 60px rgba(0, 200, 255, 0.07);
    border: 1px solid var(--border-color);
    transform: scale(1);
    transition: transform 0.22s;
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    pointer-events: none;
}

.modal.hidden .modal-content {
    transform: scale(0.96);
}

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

.modal-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

.close-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: all 0.18s ease;
}

.close-modal:hover {
    background: rgba(244, 63, 94, 0.14);
    color: var(--danger-color);
    border-color: rgba(244, 63, 94, 0.3);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-group input {
    padding: 11px 14px;
    background: rgba(240, 248, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: rgba(0, 200, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.07);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* ─── View Panels ────────────────────────────────── */
.view-panel {
    flex: 1;
    overflow: hidden;
}

.view-panel.hidden,
#view-history.hidden,
#view-dictation.hidden {
    display: none !important;
}

/* ─── History View ───────────────────────────────── */
#view-history:not(.hidden) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.history-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 26px;
    overflow: hidden;
    gap: 20px;
}

.history-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.history-header-bar h2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-header-bar h2 i {
    color: var(--primary-color);
    filter: drop-shadow(0 0 6px rgba(0, 200, 255, 0.5));
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid rgba(244, 63, 94, 0.28);
    font-size: 0.8rem;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}

.btn-danger-outline:hover {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.48);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.12);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-right: 4px;
}

.history-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 12px;
    text-align: center;
    opacity: 0.5;
}

.history-empty-state i {
    font-size: 3rem;
    color: rgba(0, 200, 255, 0.14);
}

/* ─── History Card ───────────────────────────────── */
.history-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 17px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.history-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 200, 255, 0.26);
    box-shadow: 0 10px 40px rgba(0, 200, 255, 0.1);
}

.history-card-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.13), rgba(139, 92, 246, 0.09));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.05rem;
    flex-shrink: 0;
    border: 1px solid rgba(0, 200, 255, 0.18);
}

.history-card-info {
    flex: 1;
    min-width: 0;
}

.history-card-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-date {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.history-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.history-card-actions .btn-icon {
    width: 33px;
    height: 33px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ─── Rename Feature ─────────────────────────────── */
.history-name-text {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.history-rename-btn {
    background: none;
    border: none;
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}

.history-card:hover .history-rename-btn {
    opacity: 1;
}

.history-rename-btn:hover {
    color: var(--primary-color);
    background: rgba(0, 200, 255, 0.1);
}

.history-rename-input {
    flex: 1;
    border: 1px solid rgba(0, 200, 255, 0.4);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(0, 200, 255, 0.05);
    outline: none;
    min-width: 0;
    box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.08);
}

/* ─── History Badge ──────────────────────────────── */
.history-badge {
    background: linear-gradient(135deg, #00C8FF, #0070E0);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 7px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.45);
}


/* ─── Report Title Input ─────────────────────────── */
.report-title-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.report-title-input {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-heading);
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    padding: 2px 4px;
    border-radius: 4px 4px 0 0;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    cursor: text;
}

.report-title-input:hover {
    border-bottom-color: var(--border-color);
}

.report-title-input:focus {
    border-bottom-color: var(--primary-color);
}

.report-title-pencil {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
    pointer-events: none;
}

.report-title-wrapper:hover .report-title-pencil {
    opacity: 1;
}

.report-date-input {
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-heading);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    width: 110px;
    margin-left: 8px;
    flex-shrink: 0;
}

.report-date-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 200, 255, 0.14); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 200, 255, 0.3); }

/* ─── Admin Dashboard ──────────────────────────────── */
.admin-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 26px;
    overflow-y: auto;
    gap: 22px;
}

.admin-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.admin-header-bar h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header-bar h2 i {
    color: var(--primary-color);
}

.admin-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.admin-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 12px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-filter-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-filter {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s ease;
    font-family: inherit;
}

.btn-filter:hover {
    background: rgba(0, 153, 204, 0.08);
    border-color: rgba(0, 153, 204, 0.3);
    color: var(--primary-color);
}

.btn-filter.active {
    background: var(--primary-color, #0099cc);
    color: #ffffff;
    border-color: var(--primary-color, #0099cc);
    box-shadow: 0 2px 8px rgba(0, 153, 204, 0.3);
}

.admin-filter-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-date-picker {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--text-heading);
    cursor: pointer;
    transition: border-color 0.2s;
}

.admin-date-picker:focus {
    border-color: var(--primary-color);
    outline: none;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.admin-kpi-card {
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.admin-kpi-blue {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.admin-kpi-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.admin-kpi-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.admin-kpi-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.admin-kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-kpi-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.1;
}

.admin-table-container {
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-date-indicator {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(0, 153, 204, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.admin-table th {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: rgba(0, 153, 204, 0.03);
}

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 153, 204, 0.12);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.admin-badge-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.admin-badge-zero {
    background: rgba(148, 163, 184, 0.12);
    color: #64748b;
    font-weight: 500;
}

.admin-badge-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

/* ─── Responsive ─────────────────────────────────── */
.hide-mobile { display: inline; }

@media (max-width: 1024px) {
    .app-container { flex-direction: column; }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        z-index: 20;
    }

    .top-header {
        padding: 14px 20px;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        height: auto;
    }

    .header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .workspace {
        padding: 16px 20px;
        gap: 14px;
    }

    .history-container { padding: 18px; }
    .panel { min-height: auto; }
    .modal-content { width: min(92vw, 700px); }
}

@media (max-width: 768px) {
    /* Sleek compact top navigation for mobile */
    .sidebar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 14px 10px 14px;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
        border-bottom: 1px solid var(--border-color);
        border-right: none;
        width: 100%;
    }

    .sidebar::after {
        display: none;
    }

    .logo {
        padding: 0;
        border-bottom: none;
        font-size: 0.95rem;
        gap: 8px;
        justify-content: center;
        align-self: center;
        width: 100%;
        text-align: center;
    }

    .logo i {
        width: 28px;
        height: 28px;
        font-size: 0.82rem;
    }

    .sidebar-nav-user {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100%;
    }

    .nav-menu {
        padding: 0;
        display: flex;
        flex-direction: row;
        gap: 6px;
        width: 100%;
    }

    .nav-item {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 7px 8px;
        font-size: 0.76rem;
        border-radius: var(--radius-md);
        gap: 6px;
        white-space: nowrap;
        text-align: center;
    }

    .user-section {
        margin-top: 0;
        padding: 0;
        border-top: none;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .user-section #login-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 6px 12px;
        font-size: 0.78rem;
        border-radius: var(--radius-md);
        white-space: nowrap;
        background: white;
        border: 1px solid var(--border-color);
    }

    .user-info {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 5px 10px;
        border-radius: var(--radius-md);
        background: rgba(0, 153, 204, 0.05);
        border: 1px solid rgba(0, 153, 204, 0.15);
        font-size: 0.74rem;
        min-width: 0;
        max-width: 100%;
    }

    .user-email-group {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        flex: 1;
    }

    .user-email-group i {
        font-size: 0.82rem;
        color: var(--primary-color);
        flex-shrink: 0;
    }

    #user-email {
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.74rem;
        color: var(--text-main);
        display: block;
        min-width: 0;
        flex: 1;
    }

    #logout-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    /* Page Header */
    .top-header {
        padding: 10px 14px;
        gap: 8px;
    }

    .top-header h1 {
        font-size: 0.95rem;
    }

    .hide-mobile { display: none !important; }

    .header-actions {
        gap: 6px;
        width: 100%;
        justify-content: flex-start;
    }

    .header-actions .btn {
        padding: 6px 11px;
        font-size: 0.75rem;
        border-radius: 999px;
        flex: 1 1 auto;
        min-width: max-content;
    }

    .header-toggle-label {
        padding: 5px 9px;
        font-size: 0.72rem;
        border-radius: 999px;
    }

    /* Workspace */
    .workspace {
        padding: 10px 12px;
        gap: 10px;
    }

    /* Dictation Bar (Centered Minimalist Frame on Phone) */
    .dictation-panel {
        max-width: 280px;
        width: calc(100% - 24px);
        margin: 0 auto;
        padding: 10px 14px;
        border-radius: var(--radius-md);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .record-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        text-align: center;
    }

    .record-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        font-size: 1.15rem;
    }

    .record-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2px;
        width: 100%;
    }

    .record-info-header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    .record-title {
        font-size: 0.80rem;
    }

    #record-status {
        font-size: 0.74rem;
        text-align: center;
    }

    /* Report Panel */
    .report-panel {
        border-radius: var(--radius-md);
    }

    .report-panel .panel-header {
        padding: 10px 14px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .report-title-wrapper {
        flex: 1;
        min-width: 0;
        gap: 6px;
    }

    .report-title-input {
        font-size: 0.84rem;
        flex: 1;
        min-width: 120px;
    }

    .report-date-input {
        font-size: 0.76rem;
        width: 86px;
        padding: 3px 5px;
        margin-left: 0;
    }

    .report-content {
        padding: 14px 12px;
        font-size: 0.92rem;
        min-height: 280px;
    }

    /* History & Modals */
    .history-container { padding: 12px; }
    .history-card { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
    .history-card-actions { justify-content: flex-start; flex-wrap: wrap; width: 100%; }
    .history-card-actions .btn-icon { width: auto; padding: 8px; }
    .history-header-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .modal-content { width: min(94vw, 650px); max-height: 92vh; border-radius: var(--radius-md); }
    .modal-body { padding: 14px; }
    .modal-footer { padding: 10px 14px; }
}
