/* Migrated from components.css: shared buttons, chips, status, detail/view helpers.
   Keep this before the modern standard-component rules below so newer rules win. */
.btn,
.menu-btn,
.close-btn,
.chip,
.badge,
.theme-card {
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid rgba(183,170,114,.22);
    background: linear-gradient(180deg, rgba(20,24,17,.95), rgba(12,15,11,.98));
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.btn:hover,
.btn:focus-visible {
    background: linear-gradient(180deg, rgba(183,170,114,.12), rgba(183,170,114,.05));
    border-color: rgba(209,193,137,.34);
    box-shadow: inset 0 0 0 1px rgba(209,193,137,.08);
    outline: none;
}

.btn:active {
    background: linear-gradient(180deg, rgba(183,170,114,.18), rgba(183,170,114,.08));
    border-color: rgba(209,193,137,.46);
}

.btn-small,
.standard-apply-btn,
.standard-nav-btn {
    min-height: 34px;
    padding: 7px 10px 5px 10px;
    font-size: 11px;
}

.btn-full {
    width: 100%;
}

.btn-standard,
.btn-action {
    min-width: 104px;
    width: 104px;
    justify-content: center;
    padding-inline: 10px;
}

.btn-secondary,
.standard-secondary-btn {
    border-color: rgba(112,120,98,.34);
    background: linear-gradient(180deg, rgba(18,21,15,.92), rgba(11,13,10,.98));
    height: 38px;
    
}

.btn-danger {
    border-color: rgba(179,106,95,.42);
    color: #f0d8d3;
    background: linear-gradient(180deg, rgba(179,106,95,.10), rgba(179,106,95,.04));
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background: linear-gradient(180deg, rgba(179,106,95,.18), rgba(179,106,95,.08));
    border-color: rgba(179,106,95,.58);
}

.menu-btn,
.close-btn {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid rgba(183,170,114,.16);
    background: rgba(18,21,15,.86);
    color: var(--text);
    font-size: 22px;
}

.close-btn {
    min-width: 30px;
    min-height: 30px;
    font-size: 16px;
}

.menu-btn:hover,
.close-btn:hover {
    background: var(--hover-fill);
    border-color: rgba(209,193,137,.34);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(183,170,114,.18);
    background: rgba(255,255,255,.02);
}

.flash-success {
    border-color: rgba(126,159,105,.36);
    background: rgba(126,159,105,.10);
}

.flash-error {
    border-color: rgba(179,106,95,.42);
    background: rgba(179,106,95,.12);
}

.chip,
.badge,
.table-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(183,170,114,.16);
    color: var(--text);
    text-transform: uppercase;
}

.chip {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
    letter-spacing: .14em;
    background: var(--chip-bg);
}

.chip-accent {
    border-color: rgba(209,193,137,.30);
}

.badge,
.table-status-chip {
    min-height: 24px;
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1.15;
    letter-spacing: .08em;
    background: rgba(255,255,255,.02);
}

.badge-warn,
.table-status-chip.is-accent {
    border-color: rgba(209,193,137,.32);
    background: rgba(183,170,114,.10);
}

.table-status-chip.is-warn {
    color: var(--danger);
    border-color: rgba(179,106,95,.36);
    background: rgba(179,106,95,.12);
}

.segmented {
    display: flex;
    border: 1px solid rgba(183,170,114,.16);
    margin-bottom: 16px;
}

.seg-btn {
    flex: 1;
    border: 0;
    background: #11140f;
    color: var(--muted);
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: .14em;
}

.seg-btn.is-active {
    background: var(--active-fill);
    color: var(--text);
}

.button-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.button-row > * {
    flex: 0 0 auto;
}

.wrap {
    flex-wrap: wrap;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.toolbar-grid {
    display: grid;
    grid-template-columns: 1fr 140px 140px;
    gap: 8px;
    align-items: end;
}

.toolbar-btn {
    width: 100%;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.status-badges-stack,
.table-status-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.warning-text {
    color: #f0c3c3;
}

.muted-copy,
.muted-line {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.top-gap {
    margin-top: 12px;
}

.inline-form > select {
    min-width: 180px;
}

.view-drawer-content {
    display: grid;
    gap: 14px;
}

.view-field {
    display: grid;
    gap: 6px;
}

.view-field-label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .14em;
}

.view-field-value {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(180deg, var(--input-bg-2), var(--input-bg));
    color: var(--text);
    border: 1px solid rgba(183,170,114,.16);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.detail-summary-block {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.detail-summary-meta {
    color: var(--accent);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.detail-summary-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: var(--text);
}

.detail-copy-block {
    padding: 10px 12px;
    border: 1px solid rgba(183,170,114,.12);
    background: rgba(255,255,255,.01);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.detail-pairs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-pair {
    display: grid;
    gap: 6px;
    align-content: start;
}

.detail-pair-span-2 {
    grid-column: 1 / -1;
}

.detail-pair-label {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.detail-pair-value {
    color: var(--text);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.detail-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.detail-checklist {
    display: grid;
    gap: 8px;
}

.detail-checklist-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    border: 1px solid rgba(183,170,114,.12);
    background: rgba(255,255,255,.01);
    line-height: 1.45;
}

.detail-checklist-item.is-complete {
    border-color: rgba(126,159,105,.28);
    background: rgba(126,159,105,.08);
    color: var(--muted);
}

.detail-checklist-state {
    flex: 0 0 auto;
    min-width: 12px;
    color: var(--accent);
    font-weight: 700;
}

.empty-state,
.planner-empty-day {
    padding: 10px 12px;
    border: 1px dashed rgba(183,170,99,.25);
    color: var(--muted);
    background: rgba(255,255,255,.01);
}

.standard-toolbar,
.standard-filter-row,
.standard-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
}

.standard-toolbar > *,
.standard-filter-row > *,
.standard-action-row > * {
    flex: 0 0 auto;
}

.standard-empty-state {
    padding: 14px;
    border: 1px dashed rgba(183,170,114,.20);
    background: rgba(255,255,255,.015);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.standard-card-list {
    display: grid;
    gap: 10px;
}

.standard-card-row {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(183,170,114,.14);
    background: rgba(255,255,255,.015);
}


.standard-panel {
    background: var(--v3-card-bg);
    border: 1px solid var(--v3-card-border);
    box-shadow: var(--v3-shadow-soft);
    padding: 0;
    overflow: hidden;
}

.standard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(183,170,114,.11);
}

.standard-panel-header h2,
.standard-panel-header h3 {
    margin: 0;
    text-transform: none;
    letter-spacing: -.01em;
    color: #dedbcf;
}

.standard-panel-header h2 {
    font-size: 20px;
}

.standard-panel-header h3 {
    font-size: 16px;
}

.standard-panel-body {
    padding: 16px 18px;
}

.standard-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid rgba(183,170,114,.10);
    color: var(--muted);
    font-size: 13px;
}

.standard-empty-state {
    padding: 30px 18px;
    color: var(--muted);
    text-align: center;
}

.standard-kicker {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    font-weight: 700;
}

.standard-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.standard-chip,
.standard-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid rgba(183,170,114,.14);
    background: rgba(255,255,255,.025);
    color: #d9d4c5;
    font-size: 12px;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: .01em;
}

.standard-status-chip.is-good {
    border-color: rgba(126,159,105,.35);
    background: rgba(126,159,105,.10);
    color: #b7d99d;
}

.standard-status-chip.is-warn {
    border-color: rgba(209,193,137,.38);
    background: rgba(183,170,114,.11);
    color: #e5d394;
}

.standard-status-chip.is-danger {
    border-color: rgba(179,106,95,.45);
    background: rgba(179,106,95,.12);
    color: #e8b1a9;
}

.standard-muted {
    color: var(--muted);
}

.standard-primary-btn,
.btn.standard-primary-btn {
    background: linear-gradient(180deg, rgba(133,143,76,.88), rgba(83,91,48,.92));
    border-color: rgba(209,193,137,.38);
    color: #f3eedb;
}

.standard-primary-btn:hover,
.btn.standard-primary-btn:hover {
    background: linear-gradient(180deg, rgba(153,164,88,.95), rgba(92,101,54,.98));
}

.standard-icon-btn {
    min-width: 36px;
    width: 36px;
    min-height: 34px;
    padding: 0;
}

.standard-danger-zone {
    border: 1px solid rgba(179,106,95,.24);
    background: rgba(179,106,95,.055);
    padding: 12px;
}

/* V3 second-pass: shared component hardening. */
.btn,
.menu-btn,
.close-btn,
.chip,
.badge,
.standard-chip,
.standard-status-chip,
.standard-panel,
.standard-metric-card,
.metric-icon,
.standard-title-icon,
.standard-date-pill,
.standard-family-chip,
.standard-input-with-icon,
.standard-section,
.standard-view-field,
.standard-pager a,
.standard-pager span,
input,
select,
textarea {
    border-radius: 0 !important;
}

.btn {
    min-height: 38px;
    padding: 8px 13px;
    border-color: rgba(207,197,151,.18);
    background: linear-gradient(180deg, rgba(28,32,31,.96), rgba(15,18,18,.98));
    color: rgba(230,226,211,.90);
    text-transform: none;
    letter-spacing: .01em;
    font-size: 13px;
    font-weight: 650;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.btn:hover,
.btn:focus-visible {
    background: linear-gradient(180deg, rgba(52,58,47,.96), rgba(27,31,27,.98));
    border-color: rgba(207,197,151,.30);
    color: #f4eed6;
}

.btn-small {
    min-height: 32px;
    line-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.standard-primary-btn,
.btn.standard-primary-btn {
    background: linear-gradient(180deg, rgba(129,139,78,.95), rgba(83,90,49,.98));
    border-color: rgba(207,197,151,.35);
    color: #f3eedb;
}

.standard-primary-btn:hover,
.btn.standard-primary-btn:hover {
    background: linear-gradient(180deg, rgba(148,158,91,.98), rgba(92,99,55,.98));
    border-color: rgba(224,211,151,.46);
}

.btn-secondary,
.standard-secondary-btn {
    background: linear-gradient(180deg, rgba(25,29,28,.90), rgba(14,17,17,.98));
    border-color: rgba(207,197,151,.13);
    color: rgba(225,222,209,.82);
}

.btn-danger {
    border-color: rgba(179,106,95,.42);
    color: #efc7bf;
    background: linear-gradient(180deg, rgba(93,45,39,.46), rgba(49,24,22,.34));
}

.standard-icon-btn {
    width: 38px;
    min-width: 38px;
    padding-inline: 0;
    font-size: 18px;
}

.standard-panel {
    background: linear-gradient(180deg, rgba(25,29,28,.94), rgba(15,18,18,.985));
    border-color: rgba(207,197,151,.105);
    box-shadow: 0 16px 42px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.025);
}

.standard-panel-header {
    min-height: 50px;
    padding: 12px 16px;
    border-bottom-color: rgba(207,197,151,.10);
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.012));
}

.standard-panel-header h2 {
    font-size: 17px;
    font-weight: 650;
    color: #e2ddcc;
}

.standard-panel-body {
    padding: 14px 16px;
}

.standard-panel-footer {
    min-height: 52px;
    padding: 12px 16px;
    border-top-color: rgba(207,197,151,.10);
    color: rgba(204,199,178,.70);
}

.standard-table-panel-header .standard-muted {
    font-size: 12px;
    color: rgba(204,199,178,.66);
}

.standard-chip,
.standard-status-chip {
    min-height: 24px;
    padding: 3px 8px;
    border-color: rgba(207,197,151,.13);
    background: rgba(255,255,255,.025);
    color: rgba(222,218,203,.86);
    font-size: 12px;
}

.standard-status-chip.is-good {
    border-color: rgba(126,159,105,.28);
    background: rgba(126,159,105,.075);
    color: #b8d5a2;
}

.standard-status-chip.is-warn {
    border-color: rgba(207,160,66,.33);
    background: rgba(183,133,48,.09);
    color: #e2c277;
}

.standard-status-chip.is-danger {
    border-color: rgba(179,106,95,.40);
    background: rgba(179,106,95,.10);
    color: #e4aaa2;
}

.standard-danger-zone {
    border-color: rgba(179,106,95,.22);
    background: rgba(76,33,30,.11);
}

.standard-empty-state {
    color: rgba(204,199,178,.70);
}

/* V3 seventh-pass: compact icon-only utility buttons. */
.standard-icon-only-btn {
    width: 32px;
    min-width: 32px;
    padding-inline: 0;
}

/* Google Drive / long-running action overlay. */
.standard-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(3, 5, 5, .78);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.standard-busy-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.standard-busy-card {
    width: min(380px, 100%);
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid rgba(207, 197, 151, .25);
    background: linear-gradient(180deg, rgba(25, 29, 28, .98), rgba(10, 12, 12, .99));
    box-shadow: 0 26px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.035);
}

.standard-busy-loader {
    position: relative;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(207, 197, 151, .18);
    background: rgba(255,255,255,.018);
    overflow: hidden;
}

.standard-busy-loader::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(207, 197, 151, .15);
    border-top-color: rgba(207, 197, 151, .90);
    animation: standardBusySpin .85s linear infinite;
}

.standard-busy-loader span {
    position: absolute;
    left: 7px;
    right: 7px;
    height: 2px;
    background: rgba(207, 197, 151, .34);
    animation: standardBusyScan 1.2s ease-in-out infinite;
}

.standard-busy-loader span:nth-child(1) { top: 12px; animation-delay: 0s; }
.standard-busy-loader span:nth-child(2) { top: 22px; animation-delay: .14s; }
.standard-busy-loader span:nth-child(3) { top: 32px; animation-delay: .28s; }

.standard-busy-copy strong {
    display: block;
    color: #e2ddcc;
    font-size: 15px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.standard-busy-copy p {
    margin: 5px 0 0;
    color: rgba(204,199,178,.72);
    font-size: 12px;
    line-height: 1.45;
}

.has-standard-busy-overlay {
    cursor: wait;
}

@keyframes standardBusySpin {
    to { transform: rotate(360deg); }
}

@keyframes standardBusyScan {
    0%, 100% { transform: translateX(-14px); opacity: .35; }
    50% { transform: translateX(14px); opacity: .95; }
}

@media (prefers-reduced-motion: reduce) {
    .standard-busy-overlay,
    .standard-busy-loader::before,
    .standard-busy-loader span {
        animation: none;
        transition: none;
    }
}
