﻿/* -- Design Tokens ------------------------------------------- */
:root {
    --blue-50:   #eff6ff;
    --blue-100:  #dbeafe;
    --blue-500:  #3b82f6;
    --blue-600:  #2563eb;
    --blue-700:  #1d4ed8;
    --indigo-50: #eef2ff;
    --indigo-600:#4f46e5;
    --sky-50:    #f0f9ff;
    --sky-600:   #0284c7;
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-900: #0f172a;

    /* Dark glassmorphism tokens */
    --bg-base:       #0f172a;
    --bg-surface:    rgba(255, 255, 255, 0.06);
    --bg-elevated:   rgba(255, 255, 255, 0.09);
    --bg-input:      rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-glass:  rgba(255, 255, 255, 0.12);
    --border-focus:  rgba(59, 130, 246, 0.55);
    --text-primary:  #f1f5f9;
    --text-secondary: rgba(148, 163, 184, 0.85);
    --text-muted:    rgba(148, 163, 184, 0.6);
    --glass-blur:    blur(24px) saturate(140%);
    --shadow-glass:  0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow:   0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 20px rgba(59, 130, 246, 0.08);
}

/* -- Base Reset ---------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* -- Shared Page Layout -------------------------------------- */
.page-wrapper {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.page-wrapper--gradient {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 28%),
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 22%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

/* -- Floating Orbs (shared) ---------------------------------- */
.page-wrapper::before,
.page-wrapper::after {
    content: "";
    position: absolute;
    border-radius: 42% 58% 64% 36% / 47% 34% 66% 53%;
    filter: blur(80px);
    pointer-events: none;
    will-change: transform, border-radius;
    z-index: 0;
}

.page-wrapper::before {
    width: 420px;
    height: 420px;
    background: rgba(59, 130, 246, 0.16);
    top: -8%;
    right: -6%;
    animation: orbDrift1 20s ease-in-out infinite, orbMorph1 12s ease-in-out infinite;
}

.page-wrapper::after {
    width: 340px;
    height: 340px;
    background: rgba(99, 102, 241, 0.12);
    bottom: -6%;
    left: -5%;
    animation: orbDrift2 24s ease-in-out infinite, orbMorph2 14s ease-in-out infinite;
}

/* Orb drift paths */
@keyframes orbDrift1 {
    0%        { transform: translate(0, 0) scale(1) rotate(0deg); }
    20%       { transform: translate(-40px, 50px) scale(1.08) rotate(15deg); }
    40%       { transform: translate(20px, 90px) scale(0.95) rotate(-10deg); }
    60%       { transform: translate(-60px, 30px) scale(1.12) rotate(25deg); }
    80%       { transform: translate(10px, -20px) scale(0.98) rotate(-5deg); }
    100%      { transform: translate(0, 0) scale(1) rotate(0deg); }
}

@keyframes orbDrift2 {
    0%        { transform: translate(0, 0) scale(1) rotate(0deg); }
    25%       { transform: translate(50px, -40px) scale(1.1) rotate(-20deg); }
    50%       { transform: translate(-30px, -70px) scale(0.94) rotate(15deg); }
    75%       { transform: translate(40px, 20px) scale(1.06) rotate(-10deg); }
    100%      { transform: translate(0, 0) scale(1) rotate(0deg); }
}

/* Orb wobble / morph */
@keyframes orbMorph1 {
    0%, 100%  { border-radius: 42% 58% 64% 36% / 47% 34% 66% 53%; }
    25%       { border-radius: 58% 42% 36% 64% / 34% 66% 34% 66%; }
    50%       { border-radius: 36% 64% 52% 48% / 66% 42% 58% 42%; }
    75%       { border-radius: 64% 36% 42% 58% / 52% 58% 42% 48%; }
}

@keyframes orbMorph2 {
    0%, 100%  { border-radius: 52% 48% 38% 62% / 60% 40% 56% 44%; }
    33%       { border-radius: 38% 62% 56% 44% / 44% 56% 62% 38%; }
    66%       { border-radius: 62% 38% 48% 52% / 38% 62% 44% 56%; }
}

.page-header {
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--blue-500);
    text-decoration: none;
    transition: opacity 0.2s;
}

.brand:hover {
    opacity: 0.8;
}

.brand-icon {
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.3));
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.025em;
}

.page-main {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.page-main--medium {
    max-width: 960px;
}

.page-main--large {
    max-width: 1180px;
}

.page-main--small {
    max-width: 1000px;
}

.page-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
}

.page-title-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.page-title-section h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.035em;
    margin: 0 0 0.5rem;
}

.page-title-section p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Moved from Backups.razor.css to enable global component usage */

/* -- Formular ------------------------------------------------ */
.backups-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.editor-meta-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.field--compact {
    max-width: 260px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-card--single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-flex {
    flex: 1;
}

.field-label {
    color: rgba(203, 213, 225, 0.9);
    font-size: 0.86rem;
    font-weight: 700;
}

.field-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.field-error {
    color: #fca5a5;
    font-size: 0.8rem;
}

.field-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    font: inherit;
    outline: none;
    backdrop-filter: blur(6px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.field-input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
    background: rgba(255, 255, 255, 0.1);
}

.field-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.field-input::placeholder {
    color: var(--text-muted);
}

.folder-picker__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.folder-picker__breadcrumb {
    border: none;
    background: transparent;
    color: var(--blue-500);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 8px;
}

.folder-picker__breadcrumb:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.12);
}

.folder-picker__breadcrumb:disabled,
.folder-picker__breadcrumb--active {
    color: var(--text-secondary);
    cursor: default;
}

.folder-picker__breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 1.1rem;
    padding-right: 2.8rem;
}

.row-fields {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1rem;
}

.row-fields--compact {
    grid-template-columns: 260px;
}

.directory-picker-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.05rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.directory-picker-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.directory-picker-card p {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.directory-value {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
}

    .directory-value span {
        min-width: 0;
        flex: 1;
    }

.directory-value--empty {
    color: var(--text-muted);
}

.dialog-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
}

.folder-picker {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
}

.folder-picker__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.folder-picker__current {
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.86rem;
    word-break: break-word;
}

.folder-picker__message {
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.folder-picker__message--error {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
}

.folder-picker__list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 260px;
    overflow: auto;
    padding: 0.2rem;
}

.folder-picker__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
}

.folder-picker__navigate {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.folder-picker__navigate:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.folder-picker__navigate--selected {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.folder-picker__navigate--selected svg {
    color: var(--blue-500);
}

.folder-picker__navigate svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--text-muted);
}

.folder-picker__navigate span {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-picker__navigate-arrow {
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
    color: var(--text-muted);
}

.path-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.path-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0.9rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
}

.path-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.path-text {
    min-width: 0;
    flex: 1;
    color: var(--text-primary);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove {
    width: 1.9rem;
    height: 1.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}

.btn-remove:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}

.btn-remove:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-remove svg {
    width: 1rem;
    height: 1rem;
}

.timeline-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
}

.timeline-card strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.timeline-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.inline-note {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    font-size: 0.88rem;
}

.inline-note--warn {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.history-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
}

.history-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.history-panel__head h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.history-panel__head span,
.history-empty {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.history-list {
    display: grid;
    gap: 0.75rem;
}

.btn-ghost--history {
    align-self: flex-start;
    padding: 0.72rem 0.95rem;
    font-size: 0.82rem;
}

.history-item {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.history-item__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.history-item__top strong {
    color: var(--text-primary);
    font-size: 0.86rem;
}

.history-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.87rem;
}

.history-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.26rem 0.58rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.history-badge--success {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-600);
}

.history-badge--error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

/* -- Buttons ------------------------------------------------- */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
    border: none;
    border-radius: 14px;
    padding: 0.85rem 1.15rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
    color: #fff;
    box-shadow: 0 10px 22px rgba(59, 130, 246, 0.16);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(59, 130, 246, 0.18);
}

.btn-secondary,
.btn-ghost {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
    transform: translateY(-1px);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.35);
}

.btn-secondary--run {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-500);
    border-color: rgba(59, 130, 246, 0.25);
}

.btn-secondary--compact,
.btn-ghost--compact {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(239, 68, 68, 0.18);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.icon-button {
    width: 2.8rem;
    height: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.icon-button:hover:not(:disabled) {
    transform: translateY(-1px);
    color: var(--blue-500);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.icon-button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.icon-button svg {
    width: 1.15rem;
    height: 1.15rem;
}

.icon-button--inline {
    width: 3rem;
}

.icon-button--pick {
    width: 2.6rem;
    height: 2.6rem;
}

.icon-button--toolbar {
    width: 2.65rem;
    height: 2.65rem;
}

.icon-button--toolbar-primary {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-500);
    border-color: rgba(59, 130, 246, 0.25);
}

/* -- Mobile Responsive (global) ------------------------------ */
@media (max-width: 720px) {
    .page-header {
        padding: 0.9rem 1rem;
    }

    .page-main {
        padding: 1.5rem 1rem 2.5rem;
    }

    .page-title-section {
        margin-bottom: 1.5rem;
    }

    .page-title-section h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }

    .editor-meta-grid {
        grid-template-columns: 1fr;
    }

    .row-fields {
        grid-template-columns: 1fr;
    }

    .timeline-card,
    .timeline-card--single {
        grid-template-columns: 1fr;
    }

    .directory-picker-card {
        flex-direction: column;
        align-items: stretch;
    }

    .path-text {
        white-space: normal;
        word-break: break-all;
    }

    .directory-value {
        word-break: break-all;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn-primary,
    .actions .btn-secondary,
    .actions .btn-ghost,
    .actions .btn-danger {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .history-item__meta {
        flex-direction: column;
        gap: 0.35rem;
    }

    .history-item__meta span {
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 0.75rem 0.85rem;
    }

    .brand-name {
        font-size: 0.95rem;
    }

    .brand-icon {
        width: 1.6rem;
        height: 1.6rem;
    }

    .page-main {
        padding: 1rem 0.75rem 2rem;
    }

    .page-title-section p {
        font-size: 0.88rem;
    }

    .field-input {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
        border-radius: 12px;
    }

    .field-label {
        font-size: 0.82rem;
    }

    .field--compact {
        max-width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .btn-danger {
        padding: 0.75rem 1rem;
        font-size: 0.88rem;
        border-radius: 12px;
    }

    .icon-button {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 12px;
    }

    .icon-button svg {
        width: 1rem;
        height: 1rem;
    }

    .path-item {
        padding: 0.7rem 0.75rem;
        gap: 0.5rem;
        border-radius: 12px;
    }

    .path-text {
        font-size: 0.82rem;
    }

    .directory-picker-card {
        padding: 0.85rem 0.9rem;
        border-radius: 14px;
    }

    .directory-picker-card strong {
        font-size: 0.86rem;
    }

    .directory-picker-card p {
        font-size: 0.76rem;
    }

    .directory-value {
        padding: 0.7rem 0.85rem;
        font-size: 0.82rem;
        border-radius: 12px;
    }

    .history-panel {
        padding: 0.75rem;
        border-radius: 14px;
    }

    .history-item {
        padding: 0.7rem 0.8rem;
        border-radius: 12px;
    }

    .history-item__top strong {
        font-size: 0.8rem;
    }

    .history-item p {
        font-size: 0.82rem;
    }

    .history-badge {
        font-size: 0.68rem;
        padding: 0.22rem 0.5rem;
    }

    .timeline-card {
        padding: 0.75rem;
        border-radius: 14px;
    }

    .timeline-label {
        font-size: 0.74rem;
    }

    .timeline-card strong {
        font-size: 0.86rem;
    }

    .inline-note {
        padding: 0.7rem 0.85rem;
        border-radius: 12px;
        font-size: 0.82rem;
    }

    .folder-picker {
        padding: 0.7rem;
        border-radius: 14px;
    }

    .folder-picker__current {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
        word-break: break-all;
    }

    .folder-picker__navigate {
        padding: 0.65rem 0.7rem;
        border-radius: 12px;
    }

    .folder-picker__navigate span {
        font-size: 0.82rem;
    }
}

