/* ===================================================================
   AI Meeting — visual theme aligned with kb.tokenwave.cloud/ds

   Approach: override Arco Design CSS variables for colors / radius,
   then add a small set of DS-style utility classes (.ds-*) that our
   components use for layout primitives (page head, metric row, running
   banner, empty state, etc.). No Tailwind; plain CSS only.
   =================================================================== */

/* ---------- DS design tokens (flat, no Tailwind) ------------------- */
:root {
    --ds-accent: #FF7A00;
    --ds-accent-hover: #FF8D1A;
    --ds-accent-deep: #D96400;
    --ds-accent-soft: #FFF3E6;

    --ds-canvas: #F7F7F8;
    --ds-surface: #FFFFFF;
    --ds-line: #E5E7EB;
    --ds-line-soft: #F0F1F3;

    --ds-text: #1A1A1A;
    --ds-text-2: #4A4A4A;
    --ds-text-3: #8A8A8A;

    --ds-radius-sm: 6px;
    --ds-radius: 10px;
    --ds-radius-lg: 14px;
    --ds-radius-xl: 20px;

    --ds-shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04), 0 1px 3px rgba(17, 24, 39, 0.05);
    --ds-shadow: 0 4px 14px -4px rgba(17, 24, 39, 0.08), 0 2px 4px rgba(17, 24, 39, 0.04);
    --ds-shadow-lg: 0 20px 40px -18px rgba(17, 24, 39, 0.18);
}

/* ---------- Override Arco primary palette → DS orange ------------- */
/* Arco derives primary states (hover/active/text/bg) from --primary-1..10.
   We replace the entire ramp with an orange ramp centred on #FF7A00. */
body[arco-theme],
body {
    --primary-1: #fff4e5;
    --primary-2: #ffe3bf;
    --primary-3: #ffd092;
    --primary-4: #ffba64;
    --primary-5: #ffa340;
    --primary-6: #FF7A00;  /* DS accent */
    --primary-7: #e06800;
    --primary-8: #b84f00;
    --primary-9: #8f3800;
    --primary-10: #6b2700;

    --color-link: var(--primary-6);
    --color-link-hover: var(--primary-5);

    /* Soften Arco's neutral palette to match DS surfaces. */
    --color-bg-1: var(--ds-canvas);
    --color-bg-2: var(--ds-surface);
    --color-bg-3: var(--ds-surface);
    --color-fill-1: #F3F4F6;
    --color-fill-2: #F7F8FA;

    --color-text-1: var(--ds-text);
    --color-text-2: var(--ds-text-2);
    --color-text-3: var(--ds-text-3);

    --color-border-1: var(--ds-line-soft);
    --color-border-2: var(--ds-line);
    --color-border-3: var(--ds-line);
}

body {
    background: var(--ds-canvas);
    color: var(--ds-text);
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Arco component fine-tuning ---------------------------- */

/* Cards: a bit more breathing, softer border, gentle shadow on hover. */
.arco-card {
    border-radius: var(--ds-radius-lg);
    border-color: var(--ds-line);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-sm);
    transition: box-shadow 0.15s ease;
}
.arco-card:hover {
    box-shadow: var(--ds-shadow);
}
.arco-card-header {
    border-bottom-color: var(--ds-line-soft);
    padding: 16px 20px;
}
.arco-card-body {
    padding: 18px 20px;
}

/* Buttons: rounded DS pills; keep Arco API, restyle visuals. */
.arco-btn {
    border-radius: var(--ds-radius);
    font-weight: 500;
    transition: all 0.15s ease;
}
.arco-btn-primary:not([disabled]) {
    background: linear-gradient(135deg, var(--ds-accent-hover) 0%, var(--ds-accent) 100%);
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(255, 122, 0, 0.25);
}
.arco-btn-primary:not([disabled]):hover {
    background: linear-gradient(135deg, var(--ds-accent) 0%, var(--ds-accent-deep) 100%);
    box-shadow: 0 4px 10px rgba(255, 122, 0, 0.32);
}
.arco-btn-outline:not([disabled]) {
    border-color: var(--ds-line);
    color: var(--ds-text-2);
    background: var(--ds-surface);
}
.arco-btn-outline:not([disabled]):hover {
    color: var(--ds-accent);
    border-color: var(--ds-accent);
    background: var(--ds-accent-soft);
}
.arco-btn-text:not([disabled]):hover {
    background: var(--ds-accent-soft);
    color: var(--ds-accent-deep);
}

/* Inputs */
.arco-input-wrapper,
.arco-textarea,
.arco-select-view {
    border-radius: var(--ds-radius);
}
.arco-input-wrapper:hover,
.arco-textarea:hover {
    border-color: var(--ds-accent);
}

/* Tags — soften, DS-like */
.arco-tag {
    border-radius: 999px;
    padding: 0 10px;
    font-weight: 500;
    border: none;
}

/* Tabs card mode: flush, DS feel */
.arco-tabs-type-card .arco-tabs-header-title {
    border-radius: var(--ds-radius) var(--ds-radius) 0 0 !important;
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ds-text-2);
    font-weight: 500;
    padding: 10px 18px !important;
}
.arco-tabs-type-card .arco-tabs-header-title-active {
    background: var(--ds-surface) !important;
    color: var(--ds-accent-deep) !important;
    border-color: var(--ds-line) !important;
    border-bottom-color: var(--ds-surface) !important;
}
.arco-tabs-header-ink {
    background: var(--ds-accent) !important;
}

/* Table — DS row styling */
.arco-table {
    border-radius: var(--ds-radius-lg);
    overflow: hidden;
}
.arco-table-th {
    background: #FAFAFB !important;
    color: var(--ds-text-2) !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--ds-line) !important;
}
.arco-table-tr:hover .arco-table-td {
    background: var(--ds-accent-soft) !important;
}

/* Dropdown menu */
.arco-dropdown-menu {
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow-lg);
    border: 1px solid var(--ds-line);
    padding: 6px;
}
.arco-dropdown-menu-item {
    border-radius: 6px;
    font-size: 13px;
    padding: 8px 12px;
}

/* Alerts */
.arco-alert {
    border-radius: var(--ds-radius);
    border-width: 1px;
}

/* Menu — horizontal brand touch */
.arco-menu-horizontal .arco-menu-item {
    border-radius: var(--ds-radius) var(--ds-radius) 0 0;
    color: var(--ds-text-2);
    font-weight: 500;
}
.arco-menu-horizontal .arco-menu-selected {
    color: var(--ds-accent-deep) !important;
    background: transparent !important;
}
.arco-menu-horizontal .arco-menu-selected::after {
    background: var(--ds-accent) !important;
}

/* ---------- App shell --------------------------------------------- */

.app-header {
    background: var(--ds-surface) !important;
    border-bottom: 1px solid var(--ds-line) !important;
    height: 60px;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--ds-accent-hover), var(--ds-accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(255, 122, 0, 0.3);
}

.main-content {
    background: var(--ds-canvas) !important;
}

/* ---------- DS utility classes used by components ----------------- */

/* Page head block: big title + subtitle + right actions. */
.ds-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.ds-page-head h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--ds-text);
    line-height: 1.3;
}
.ds-page-head .ds-subtitle {
    font-size: 13px;
    color: var(--ds-text-3);
    margin-top: 6px;
}

/* Running-tasks banner on the list page. */
.ds-running-banner {
    background: linear-gradient(135deg, #FFF7EC 0%, #FFEDDB 100%);
    border: 1px solid #FFD6A5;
    border-radius: var(--ds-radius-lg);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ds-running-banner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
    color: var(--ds-accent-deep);
}
.ds-running-banner-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--ds-text-2);
}
.ds-running-banner-row .ds-banner-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.ds-running-banner-row .ds-banner-name:hover {
    color: var(--ds-accent-deep);
    text-decoration: underline;
}
.ds-running-banner-row .arco-progress {
    width: 180px;
}

/* Soft pill badges mimicking `badge green/orange/red/blue/purple`. */
.ds-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}
.ds-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.75;
}
.ds-badge.tone-green { background: #ECFDF5; color: #047857; }
.ds-badge.tone-orange { background: #FFF3E6; color: #B84F00; }
.ds-badge.tone-red { background: #FEF2F2; color: #B91C1C; }
.ds-badge.tone-blue { background: #EFF6FF; color: #1D4ED8; }
.ds-badge.tone-purple { background: #F5F3FF; color: #6D28D9; }
.ds-badge.tone-amber { background: #FFFBEB; color: #B45309; }
.ds-badge.tone-gray { background: #F3F4F6; color: #4B5563; }
.ds-badge.tone-orange.is-spinning::before,
.ds-badge.tone-blue.is-spinning::before,
.ds-badge.tone-purple.is-spinning::before,
.ds-badge.tone-amber.is-spinning::before {
    animation: ds-badge-pulse 1.3s ease-in-out infinite;
}
@keyframes ds-badge-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1); }
}

/* Thin horizontal progress bar used in the status column. */
.ds-progress-track {
    position: relative;
    width: 120px;
    height: 6px;
    background: var(--ds-line);
    border-radius: 999px;
    overflow: hidden;
}
.ds-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ds-accent-hover), var(--ds-accent));
    transition: width 0.4s ease;
}
.ds-progress-fill.is-green { background: linear-gradient(90deg, #34D399, #059669); }
.ds-progress-fill.is-red { background: linear-gradient(90deg, #F87171, #DC2626); }
.ds-progress-fill.is-indeterminate {
    width: 40% !important;
    animation: ds-progress-indeterminate 1.6s ease-in-out infinite;
}
@keyframes ds-progress-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(340%); }
}
.ds-progress-text {
    font-size: 11px;
    color: var(--ds-text-3);
    margin-top: 2px;
}

/* Metric row — small stat cards under meeting title. */
.ds-metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 20px;
}
.ds-metric {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}
.ds-metric-label {
    font-size: 11px;
    color: var(--ds-text-3);
    letter-spacing: 0.02em;
}
.ds-metric-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
}

/* ---- Hero Card -------------------------------------------------------- */
.ds-hero-card {
    position: relative;
    border-radius: var(--ds-radius-lg);
    padding: 1px;
    background: linear-gradient(125deg, rgba(255,122,0,.22) 0%, rgba(255,141,26,.08) 50%, rgba(229,231,235,.6) 100%);
    box-shadow: var(--ds-shadow);
    margin-bottom: 16px;
}
.ds-hero-card-inner {
    border-radius: calc(var(--ds-radius-lg) - 1px);
    background: var(--ds-surface);
    padding: 20px 24px 18px;
}
.ds-hero-kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ds-accent);
}
.ds-hero-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 4px 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ds-hero-meta {
    font-size: 13px;
    color: var(--ds-text-3);
}

/* ---- Stat Grid -------------------------------------------------------- */
.ds-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 0 20px;
}
@media (max-width: 720px) {
    .ds-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
    .ds-stat-grid { grid-template-columns: 1fr; }
}
.ds-stat-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ds-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ds-stat-icon.orange { background: linear-gradient(135deg, rgba(255,141,26,.15), rgba(255,122,0,.07)); color: var(--ds-accent); }
.ds-stat-icon.green  { background: linear-gradient(135deg, rgba(16,185,129,.15), rgba(5,150,105,.07));  color: #059669; }
.ds-stat-icon.blue   { background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(37,99,235,.07));  color: #2563EB; }
.ds-stat-icon.purple { background: linear-gradient(135deg, rgba(139,92,246,.15), rgba(124,58,237,.07)); color: #7C3AED; }
.ds-stat-icon.teal   { background: linear-gradient(135deg, rgba(20,184,166,.15), rgba(13,148,136,.07)); color: #0D9488; }
.ds-stat-icon.rose   { background: linear-gradient(135deg, rgba(244,63,94,.15),  rgba(225,29,72,.07));  color: #E11D48; }
.ds-stat-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ds-stat-label { font-size: 11.5px; color: var(--ds-text-3); }
.ds-stat-value { font-size: 18px; font-weight: 700; color: var(--ds-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Stage Stepper ---------------------------------------------------- */
.ds-stepper {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}
.ds-stepper::-webkit-scrollbar { display: none; }
.ds-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--ds-radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ds-text-3);
    white-space: nowrap;
    flex-shrink: 0;
}
.ds-step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #D1D5DB;
    flex-shrink: 0;
}
.ds-step.done  { color: #059669; }
.ds-step.done  .ds-step-dot { background: #10B981; }
.ds-step.active { color: var(--ds-accent-deep); background: var(--ds-accent-soft); }
.ds-step.active .ds-step-dot { background: var(--ds-accent); animation: ds-badge-pulse 1.3s ease-in-out infinite; }
.ds-step.locked { opacity: .45; }
.ds-step-sep {
    flex-shrink: 0;
    width: 18px;
    height: 1px;
    background: var(--ds-line);
    margin: 0 2px;
}

/* Empty state placeholder. */
.ds-empty {
    text-align: center;
    padding: 56px 16px;
    color: var(--ds-text-3);
}
.ds-empty-icon {
    font-size: 44px;
    line-height: 1;
    margin-bottom: 14px;
    opacity: 0.6;
}
.ds-empty-title {
    color: var(--ds-text-2);
    font-size: 14px;
    margin-bottom: 16px;
}
.ds-empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Meeting detail — tabs as a white surface card, consistent with stat cards above */
.meeting-detail .arco-tabs {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-sm);
    overflow: hidden;
}
.meeting-detail .arco-tabs-content-inner {
    background: var(--ds-surface);
    padding: 16px;
}

/* Minutes tab DS sections */
.ds-minutes-section {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--ds-shadow-sm);
}
.ds-minutes-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-accent-deep);
    padding: 11px 16px;
    border-bottom: 1px solid var(--ds-line);
    background: var(--ds-accent-soft);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ds-minutes-section-title::before {
    content: '';
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--ds-accent);
    flex-shrink: 0;
}
.ds-minutes-section-title.accent-blue { color: #1D4ED8; background: #EFF6FF; }
.ds-minutes-section-title.accent-blue::before { background: #2563EB; }
.ds-minutes-section-title.accent-green { color: #065F46; background: #ECFDF5; }
.ds-minutes-section-title.accent-green::before { background: #059669; }
.ds-minutes-body {
    padding: 14px 16px;
}
.ds-minutes-paragraph {
    font-size: 14px;
    line-height: 1.75;
    color: var(--ds-text-2);
    margin: 0;
}
.ds-minutes-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.ds-minutes-list li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--ds-text-2);
    padding-left: 14px;
    position: relative;
}
.ds-minutes-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ds-line);
    flex-shrink: 0;
}
.ds-minutes-topic {
    font-weight: 600;
    color: var(--ds-text);
}
.ds-minutes-owner {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ds-accent-deep);
    background: var(--ds-accent-soft);
    border-radius: 4px;
    padding: 1px 6px;
    margin-right: 8px;
}
.ds-minutes-meta {
    font-size: 12px;
    color: var(--ds-text-3);
    margin-left: 6px;
}
.ds-minutes-deadline {
    display: inline-block;
    font-size: 11.5px;
    color: #B91C1C;
    background: #FEF2F2;
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 8px;
}

/* Recording indicator & typewriter cursor (kept from previous stylesheet) */
.pulse-dot {
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--ds-accent);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    color: var(--ds-accent);
}
@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}
