/* Home ATJ — Google Drive inspired dark UI */
:root {
    --atj-bg: #0e0e10;
    --atj-bg-elevated: #17171a;
    --atj-bg-card: #1e1e22;
    --atj-bg-hover: #2a2a30;
    --atj-border: rgba(255, 255, 255, 0.08);
    --atj-text: rgba(255, 255, 255, 0.92);
    --atj-text-muted: rgba(255, 255, 255, 0.55);
    --atj-accent: #8ab4f8;
    --atj-accent-strong: #aecbfa;
    --atj-gold: #e6c43c;
    --atj-danger: #f28b82;
    --atj-radius: 12px;
    --atj-font: "DM Sans", system-ui, sans-serif;
    --atj-font-display: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.home-atj-auth-body,
.home-atj-app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--atj-font);
    color: var(--atj-text);
    background: var(--atj-bg);
}

/* ——— Auth ——— */
.home-atj-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.home-atj-auth__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(138, 180, 248, 0.15), transparent),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(230, 196, 60, 0.12), transparent),
        var(--atj-bg);
}

.home-atj-auth__bg--admin {
    background:
        radial-gradient(ellipse 70% 50% at 70% 30%, rgba(242, 139, 130, 0.12), transparent),
        var(--atj-bg);
}

.home-atj-auth__card {
    position: relative;
    width: min(420px, 100%);
    padding: 2.25rem;
    border-radius: 20px;
    background: rgba(23, 23, 26, 0.92);
    border: 1px solid var(--atj-border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.home-atj-auth__brand {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.home-atj-auth__logo {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--atj-gold), #c9a82a);
    color: #111;
    font-family: var(--atj-font-display);
    font-weight: 800;
    font-size: 1rem;
}

.home-atj-auth__logo--admin {
    background: linear-gradient(135deg, #8ab4f8, #669df6);
    color: #0d1117;
}

.home-atj-auth__brand h1 {
    margin: 0;
    font-family: var(--atj-font-display);
    font-size: 1.35rem;
}

.home-atj-auth__brand p {
    margin: 0.25rem 0 0;
    color: var(--atj-text-muted);
    font-size: 0.9rem;
}

.home-atj-auth__form label {
    display: block;
    margin-bottom: 1rem;
}

.home-atj-auth__form label span {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--atj-text-muted);
}

.home-atj-auth__form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--atj-border);
    background: var(--atj-bg);
    color: var(--atj-text);
    font: inherit;
}

.home-atj-auth__form input:focus {
    outline: 2px solid rgba(138, 180, 248, 0.45);
    border-color: var(--atj-accent);
}

.home-atj-auth__form em {
    display: block;
    margin-top: 0.35rem;
    color: var(--atj-danger);
    font-size: 0.82rem;
    font-style: normal;
}

.home-atj-auth__footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--atj-text-muted);
}

.home-atj-auth__footer a {
    color: var(--atj-accent);
    text-decoration: none;
}

/* ——— Shell ——— */
.home-atj-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.home-atj-shell--editor,
.home-atj-shell--admin {
    display: block;
    grid-template-columns: unset;
}

.home-atj-sidebar {
    background: var(--atj-bg-elevated);
    border-right: 1px solid var(--atj-border);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.home-atj-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--atj-font-display);
}

.home-atj-sidebar__logo {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--atj-gold);
    color: #111;
    font-weight: 800;
    font-size: 0.75rem;
}

.home-atj-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.home-atj-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--atj-text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}

.home-atj-nav-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.75;
}

.home-atj-nav-item:hover,
.home-atj-nav-item.is-active {
    background: var(--atj-bg-hover);
}

.home-atj-nav-item.is-active {
    background: rgba(138, 180, 248, 0.18);
    color: var(--atj-accent-strong);
}

.home-atj-sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border-top: 1px solid var(--atj-border);
    margin-top: auto;
}

.home-atj-sidebar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--atj-accent);
    color: #0d1117;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.home-atj-sidebar__user strong {
    display: block;
    font-size: 0.88rem;
}

.home-atj-sidebar__user small {
    color: var(--atj-text-muted);
    font-size: 0.75rem;
}

.home-atj-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-atj-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--atj-border);
}

.home-atj-search {
    flex: 1;
    max-width: 720px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--atj-bg-elevated);
    border: 1px solid transparent;
}

.home-atj-search:focus-within {
    border-color: rgba(138, 180, 248, 0.35);
    background: var(--atj-bg-card);
}

.home-atj-search svg {
    width: 20px;
    height: 20px;
    opacity: 0.55;
}

.home-atj-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--atj-text);
    font: inherit;
}

.home-atj-search input:focus { outline: none; }

.home-atj-content {
    padding: 1rem 1.25rem 2rem;
}

.home-atj-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.home-atj-breadcrumb button {
    border: none;
    background: none;
    color: var(--atj-text-muted);
    font: inherit;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
}

.home-atj-breadcrumb button:hover {
    background: var(--atj-bg-hover);
    color: var(--atj-text);
}

.home-atj-breadcrumb .is-current {
    color: var(--atj-text);
    font-weight: 600;
}

.home-atj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.65rem;
}

.home-atj-folder-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--atj-radius);
    border: 1px solid transparent;
    background: var(--atj-bg-card);
    color: var(--atj-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.home-atj-folder-card:hover {
    background: var(--atj-bg-hover);
    border-color: var(--atj-border);
}

.home-atj-folder-card.is-selected {
    background: rgba(138, 180, 248, 0.18);
    border-color: #8ab4f8;
    box-shadow: inset 0 0 0 1px rgba(138, 180, 248, 0.45);
}

.home-atj-selection-hint {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    color: var(--atj-text-muted);
    background: var(--atj-bg-elevated);
    border: 1px solid var(--atj-border);
    border-radius: 8px;
}

.home-atj-selection-hint kbd {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--atj-border);
    background: var(--atj-bg-card);
    font-size: 0.72rem;
}

.home-atj-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.home-atj-modal__backdrop {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.home-atj-modal__panel {
    position: relative;
    width: min(480px, 100%);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: var(--atj-bg-card);
    border: 1px solid var(--atj-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.home-atj-modal__title {
    margin: 0 0 0.75rem;
    font-family: var(--atj-font-display);
    font-size: 1.1rem;
}

.home-atj-modal__text {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--atj-text-muted);
}

.home-atj-modal__list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.home-atj-modal__check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--atj-text-muted);
}

.home-atj-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.home-atj-folder-card__icon { font-size: 1.35rem; }

.home-atj-folder-card__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-atj-folder-card__size {
    font-size: 0.72rem;
    color: var(--atj-text-muted);
}

.home-atj-folder-card__trash-path {
    font-size: 0.68rem;
    color: var(--atj-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.home-atj-storage {
    margin: 0 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--atj-border);
}

.home-atj-storage__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.home-atj-storage__row strong {
    color: var(--atj-accent-strong);
}

.home-atj-storage__meta,
.home-atj-storage__folder {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--atj-text-muted);
}

.home-atj-nav-item__badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(138, 180, 248, 0.22);
    color: var(--atj-accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
}

.home-atj-btn--danger {
    color: #ff8b8b;
    border: 1px solid rgba(255, 107, 107, 0.35);
}

.home-atj-link-btn {
    border: none;
    background: none;
    color: var(--atj-accent-strong);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.home-atj-link-btn--danger {
    color: #ff8b8b;
}

.home-atj-context-menu__item--danger {
    color: #ff9b9b;
}

.home-atj-empty {
    grid-column: 1 / -1;
    padding: 3rem;
    text-align: center;
    color: var(--atj-text-muted);
}

/* ——— Buttons ——— */
.home-atj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.home-atj-btn--primary {
    background: var(--atj-accent);
    color: #0d1117;
}

.home-atj-btn--primary:hover { background: var(--atj-accent-strong); }

.home-atj-btn--ghost {
    background: transparent;
    color: var(--atj-accent);
    border: 1px solid var(--atj-border);
}

.home-atj-btn--new {
    width: calc(100% - 1rem);
    margin: 0 0.5rem;
    background: rgba(138, 180, 248, 0.12);
    color: var(--atj-accent-strong);
}

.home-atj-btn--new:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.home-atj-new-menu {
    position: relative;
    margin-bottom: 0.25rem;
}

.home-atj-new-menu__panel {
    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    top: calc(100% + 0.35rem);
    z-index: 30;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--atj-border);
    background: var(--atj-bg-elevated);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.home-atj-new-menu__item {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--atj-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.home-atj-new-menu__item:hover {
    background: var(--atj-bg-hover);
}

.home-atj-new-menu__hint {
    margin: 0;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    color: var(--atj-text-muted);
}

.home-atj-import-btn {
    cursor: pointer;
}

.home-atj-dropzone {
    position: relative;
    min-height: 320px;
}

.home-atj-dropzone.is-dragover {
    outline: 2px dashed var(--atj-accent);
    outline-offset: -8px;
    background: rgba(138, 180, 248, 0.06);
}

.home-atj-dropzone__hint {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--atj-accent-strong);
    background: rgba(14, 14, 16, 0.72);
    pointer-events: none;
}

.home-atj-dropzone__hint.is-visible {
    display: flex;
}

.home-atj-upload-progress {
    margin-bottom: 1rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    background: rgba(138, 180, 248, 0.15);
    color: var(--atj-accent-strong);
    font-size: 0.9rem;
}

.home-atj-new-folder {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    border-radius: 10px;
    background: var(--atj-bg-card);
    border: 1px solid var(--atj-border);
}

.home-atj-new-folder input {
    flex: 1;
    min-width: 200px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--atj-border);
    background: var(--atj-bg);
    color: var(--atj-text);
    font: inherit;
}

.home-atj-folder-card.is-droppable {
    position: relative;
}

.home-atj-folder-card.is-dragover {
    border-color: var(--atj-accent) !important;
    background: rgba(138, 180, 248, 0.12) !important;
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.35);
}

.home-atj-folder-card__drop-hint {
    display: none;
    font-size: 0.72rem;
    color: var(--atj-accent);
    white-space: nowrap;
}

.home-atj-folder-card.is-dragover .home-atj-folder-card__drop-hint {
    display: block;
}

.home-atj-toast--error {
    background: #c5221f;
}

[x-cloak] {
    display: none !important;
}

.home-atj-icon-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--atj-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

.home-atj-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.home-atj-alert--error {
    background: rgba(242, 139, 130, 0.15);
    color: var(--atj-danger);
}

.home-atj-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    background: #1e8e3e;
    color: #fff;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* ——— Spreadsheet editor (thème clair type Google Sheets) ——— */
body.home-atj-app-body:has(.home-atj-shell--editor) {
    background: #e8eaed;
    color: #202124;
}

.home-atj-shell--editor {
    min-height: 100vh;
    background: #e8eaed;
    color: #202124;
}

.home-atj-shell--editor .home-atj-btn--ghost {
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #1a73e8;
}

.home-atj-shell--editor .home-atj-btn--ghost:hover {
    background: #f1f3f4;
}

.home-atj-editor-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #dadce0;
    background: #ffffff;
    color: #202124;
}

.home-atj-editor-bar__title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
}

.home-atj-editor-bar__title input {
    flex: 1;
    max-width: 480px;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #dadce0;
    background: #ffffff;
    color: #202124;
    font: inherit;
}

.home-atj-format-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.55rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dadce0;
}

.home-atj-format-bar__ref {
    min-width: 3rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5f6368;
    text-align: center;
}

.home-atj-format-bar__group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.home-atj-format-bar__colors {
    gap: 0.2rem;
}

.home-atj-format-bar__label {
    font-size: 0.75rem;
    color: #5f6368;
    margin-right: 0.15rem;
}

.home-atj-format-btn {
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #3c4043;
    font-size: 0.9rem;
    cursor: pointer;
}

.home-atj-format-btn:hover:not(:disabled) {
    background: #e8eaed;
}

.home-atj-format-btn.is-active {
    background: #d2e3fc;
    color: #185abc;
    border-color: #aecbfa;
}

.home-atj-format-btn:disabled,
.home-atj-swatch:disabled,
.home-atj-color-input input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.home-atj-format-btn--clear {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 0 0.75rem;
}

.home-atj-format-select select {
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #ffffff;
    color: #3c4043;
    font: inherit;
    font-size: 0.82rem;
}

.home-atj-swatch {
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.home-atj-swatch.is-active {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #ffffff inset;
}

.home-atj-color-input {
    display: inline-flex;
    align-items: center;
}

.home-atj-color-input input[type="color"] {
    width: 2rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-atj-sheet-wrap {
    overflow: auto;
    max-height: calc(100vh - 220px);
    padding: 1rem;
    background: #e8eaed;
    position: relative;
    overscroll-behavior: contain;
}

.home-atj-sheet {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: auto;
    font-size: 0.85rem;
    background: #ffffff;
    color: #202124;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25);
}

.home-atj-sheet thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.home-atj-sheet__col-num {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
}

.home-atj-sheet th,
.home-atj-sheet td {
    border: 1px solid #d0d7de;
    padding: 0;
    min-width: 0;
    background-color: #ffffff;
    color: #202124;
    overflow: hidden;
    box-sizing: border-box;
}

.home-atj-sheet__row-num {
    background: #f8f9fa !important;
    color: #5f6368 !important;
    min-width: 48px !important;
    width: 48px;
    text-align: center;
    padding: 0.35rem !important;
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 2;
    cursor: pointer;
    user-select: none;
}

.home-atj-sheet__row-num.is-selected {
    background: #d2e3fc !important;
    color: #185abc !important;
}

.home-atj-sheet__corner {
    background: #f8f9fa !important;
    min-width: 48px !important;
    width: 48px;
    position: sticky;
    left: 0;
    top: 0;
    z-index: 6;
}

.home-atj-sheet__col-head {
    background: #f8f9fa !important;
    color: #5f6368 !important;
    min-width: 0;
    text-align: center;
    padding: 0.35rem !important;
    font-weight: 600;
    font-size: 0.78rem;
    position: sticky;
    top: 0;
    z-index: 5;
    cursor: pointer;
    user-select: none;
    overflow: visible;
    box-shadow: inset 0 -1px 0 #d0d7de;
}

.home-atj-sheet__col-head.is-selected {
    background: #d2e3fc !important;
    color: #185abc !important;
}

.home-atj-sheet__col-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.home-atj-col-resize {
    position: absolute;
    top: 0;
    right: -2px;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    z-index: 6;
}

.home-atj-col-resize:hover,
.home-atj-sheet-wrap.is-col-resizing .home-atj-col-resize {
    background: #1a73e8;
}

.home-atj-sheet-wrap.is-col-resizing {
    cursor: col-resize;
    user-select: none;
}

.home-atj-sheet-wrap.is-col-resizing * {
    cursor: col-resize !important;
}

.home-atj-sheet-hint {
    margin: 0;
    padding: 0.35rem 1.25rem;
    font-size: 0.78rem;
    color: #5f6368;
    background: #f8f9fa;
    border-bottom: 1px solid #dadce0;
}

.home-atj-sheet-hint kbd {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid #dadce0;
    background: #ffffff;
    font-size: 0.72rem;
}

.home-atj-sheet__cell {
    vertical-align: middle;
    text-align: center;
    cursor: cell;
    user-select: none;
}

.home-atj-sheet__cell.is-selected {
    box-shadow: inset 0 0 0 2px #1a73e8;
    background-color: rgba(26, 115, 232, 0.06);
}

.home-atj-sheet__cell.is-editing {
    box-shadow: inset 0 0 0 2px #1a73e8;
    padding: 0;
}

.home-atj-sheet__value {
    display: block;
    padding: 0.45rem 0.55rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.35;
    min-height: 1.5rem;
    pointer-events: none;
}

.home-atj-sheet td input {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    padding: 0.45rem 0.55rem;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: inherit;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-atj-sheet td input:focus {
    outline: none;
    background: transparent;
}

.home-atj-sheet-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.home-atj-context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 240px;
    padding: 0.35rem 0;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.28);
}

.home-atj-context-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #202124;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.home-atj-context-menu__item:hover {
    background: #f1f3f4;
}

.home-atj-context-menu__item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.home-atj-context-menu__sep {
    margin: 0.35rem 0;
    border: none;
    border-top: 1px solid #e8eaed;
}

.home-atj-context-menu__kbd {
    font-size: 0.72rem;
    color: #5f6368;
}

/* ——— Admin ——— */
.home-atj-admin-grid {
    display: grid;
    gap: 1.25rem;
    padding: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.home-atj-panel {
    background: var(--atj-bg-card);
    border: 1px solid var(--atj-border);
    border-radius: var(--atj-radius);
    padding: 1.25rem;
}

.home-atj-panel--wide { grid-column: 1 / -1; }

.home-atj-panel h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-family: var(--atj-font-display);
}

.home-atj-form-grid {
    display: grid;
    gap: 0.65rem;
}

.home-atj-form-grid input,
.home-atj-form-grid select {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--atj-border);
    background: var(--atj-bg);
    color: var(--atj-text);
    font: inherit;
}

.home-atj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.home-atj-table th,
.home-atj-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--atj-border);
    text-align: left;
}

.home-atj-table th {
    color: var(--atj-text-muted);
    font-weight: 500;
}

@media (max-width: 900px) {
    .home-atj-shell {
        grid-template-columns: 1fr;
    }
    .home-atj-sidebar {
        display: none;
    }
}

.home-atj-main--full {
    grid-column: 1 / -1;
    min-height: 100vh;
}

.home-atj-topbar--file {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.home-atj-file-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.home-atj-file-preview {
    padding: 1rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: calc(100vh - 80px);
}

.home-atj-file-preview__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.home-atj-file-preview__frame {
    width: 100%;
    flex: 1;
    min-height: 70vh;
    border: 1px solid var(--atj-border);
    border-radius: 12px;
    background: #fff;
}

.home-atj-file-preview__image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    background: var(--atj-surface);
    border-radius: 12px;
    padding: 1rem;
}

.home-atj-file-preview__image {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
}

.home-atj-file-preview__media {
    width: 100%;
    max-width: 640px;
}

.home-atj-file-preview__hint {
    color: var(--atj-text-muted);
    font-size: 0.88rem;
    margin: 0;
}

.home-atj-file-preview__docx {
    background: #fff;
    border-radius: 12px;
    min-height: 70vh;
    overflow: auto;
    padding: 1rem;
}

.home-atj-file-preview__docx-inner {
    margin: 0 auto;
    max-width: 900px;
}

.home-atj-file-preview__loading {
    color: var(--atj-text-muted);
    padding: 3rem;
    text-align: center;
}

.home-atj-document-editor {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 1rem 1.25rem 1.5rem;
}

.home-atj-document-editor__page {
    background: #fff;
    border-radius: 12px;
    color: #111;
    flex: 1;
    min-height: 70vh;
}

.home-atj-document-editor .ql-toolbar {
    background: var(--atj-bg-elevated);
    border: 1px solid var(--atj-border);
    border-radius: 12px 12px 0 0;
}

.home-atj-document-editor .ql-container {
    border: 1px solid var(--atj-border);
    border-radius: 0 0 12px 12px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    min-height: 65vh;
}

.home-atj-document-editor .ql-editor {
    min-height: 65vh;
    padding: 2rem 2.5rem;
}
