/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ==========================================================================
   Design Tokens - Windows Explorer inspired
   ========================================================================== */

:root {
    /* Colors - Windows 11 inspired */
    --color-bg: #f3f3f3;
    --color-surface: #ffffff;
    --color-border: #d1d1d1;
    --color-border-light: #e5e5e5;
    --color-text: #1a1a1a;
    --color-text-secondary: #616161;
    --color-primary: #0078d4;
    --color-primary-hover: #106ebe;
    --color-hover-bg: #e5f3ff;
    --color-selected-bg: #cce8ff;
    --color-selected-border: #0078d4;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Radius - Windows uses sharper corners */
    --radius-sm: 2px;
    --radius: 4px;
    --radius-lg: 6px;

    /* Shadows - Windows style */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    padding: var(--space-lg);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--space-md) 0;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--space-md) 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

p {
    margin: 0 0 var(--space-md) 0;
}

/* Icons - base styles */
.icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ==========================================================================
   File Explorer List
   ========================================================================== */

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.file-list li {
    display: flex;
    align-items: center;
    padding: 6px var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.1s ease;
    cursor: default;
}

.file-list li:last-child {
    border-bottom: none;
}

@media (hover: hover) {
    .file-list li:hover {
        background-color: var(--color-hover-bg);
    }
}

.file-list li:active {
    background-color: var(--color-selected-bg);
}

/* File/Folder Item Wrapper */
.file-list-item {
    flex-grow: 1;
    min-width: 0;
}

.file-list-display {
    display: flex;
    align-items: center;
    width: 100%;
}

.file-list-display[hidden] {
    display: none;
}

/* File/Folder Link - fills the full row */
.file-list-link {
    display: flex;
    align-items: center;
    flex-grow: 1;
    color: var(--color-text);
    text-decoration: none;
}

.file-list-link:hover {
    color: var(--color-text);
    text-decoration: none;
}

/* File/Folder Icons */
.file-list .icon {
    margin-right: var(--space-sm);
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

/* File/Folder Name */
.file-list-name {
    flex-shrink: 1;
    min-width: 0;
}

/* File Size Metadata - pushed to the right */
.file-list .file-meta {
    color: var(--color-text-secondary);
    font-size: 0.85em;
    margin-left: auto;
    padding-left: var(--space-md);
    flex-shrink: 0;
}

/* ==========================================================================
   Bucket List (Index page)
   ========================================================================== */

.bucket-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.bucket-list li {
    display: flex;
    align-items: center;
    padding: 6px var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.1s ease;
    cursor: default;
}

.bucket-list li:last-child {
    border-bottom: none;
}

@media (hover: hover) {
    .bucket-list li:hover {
        background-color: var(--color-hover-bg);
    }
}

.bucket-list li .icon {
    margin-right: var(--space-sm);
    color: var(--color-text-secondary);
}

.bucket-list a {
    color: var(--color-text);
    text-decoration: none;
}

.bucket-list a:hover {
    color: var(--color-text);
    text-decoration: none;
}

/* ==========================================================================
   Breadcrumbs - Windows Address Bar Style
   ========================================================================== */

.breadcrumbs {
    margin-bottom: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 4px var(--space-sm);
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin: 0 6px;
    color: var(--color-text-secondary);
    font-size: 1rem;
}

.breadcrumbs a {
    color: var(--color-text);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

@media (hover: hover) {
    .breadcrumbs a:hover {
        color: var(--color-text);
        background-color: var(--color-hover-bg);
        text-decoration: none;
    }
}

.breadcrumbs strong {
    color: var(--color-text);
    font-weight: 400;
    padding: 2px 4px;
}

/* ==========================================================================
   Page Header - Title + Actions inline
   ========================================================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.page-header h1 {
    margin: 0;
    flex-shrink: 0;
}

/* ==========================================================================
   Toolbar - Windows Ribbon Style
   ========================================================================== */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.toolbar a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.1s ease;
}

@media (hover: hover) {
    .toolbar a:hover {
        background: var(--color-hover-bg);
        border-color: var(--color-border);
        text-decoration: none;
    }
}

.toolbar a:active {
    background: var(--color-selected-bg);
    border-color: var(--color-selected-border);
}

.toolbar a.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.toolbar a.primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: white;
}

/* Toolbar separator */
.toolbar .separator {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 var(--space-sm);
    align-self: center;
}

/* Toolbar form (for inline forms like sort dropdown) */
.toolbar form {
    display: contents;
}

/* Toolbar select */
.toolbar select {
    padding: 5px 8px;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.1s ease;
}

@media (hover: hover) {
    .toolbar select:hover {
        background: var(--color-hover-bg);
        border-color: var(--color-primary);
    }
}

.toolbar select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ==========================================================================
   Dropdown Menu (Mobile Actions)
   ========================================================================== */

.dropdown {
    position: relative;
    display: none;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.1s ease;
}

.dropdown-toggle:hover {
    background: var(--color-hover-bg);
    border-color: var(--color-primary);
}

.dropdown-toggle::after {
    content: "...";
    letter-spacing: 1px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    padding: 4px 0;
}

.dropdown-menu a {
    display: block;
    padding: 8px 12px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
}

.dropdown-menu a:hover {
    background: var(--color-hover-bg);
    text-decoration: none;
}

.dropdown-menu a.primary {
    color: var(--color-primary);
    font-weight: 500;
}

.dropdown:focus-within .dropdown-menu,
.dropdown:hover .dropdown-menu {
    display: block;
}

/* ==========================================================================
   File Detail Page
   ========================================================================== */

.file-detail {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
}

.file-detail h1 {
    margin-bottom: var(--space-xs);
    font-size: 1.1rem;
}

.file-detail .file-info {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.file-detail .file-notes {
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.file-detail .file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: var(--space-md) 0;
    padding: var(--space-sm);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

.file-detail .file-actions a {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.1s ease;
}

.file-detail .file-actions a:hover {
    background: var(--color-hover-bg);
    border-color: var(--color-primary);
}

.file-detail .file-actions a.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.file-detail .file-actions a.primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: white;
}

.file-detail .file-preview {
    margin: var(--space-md) 0;
    padding: var(--space-sm);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    text-align: center;
}

.file-detail .file-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color-border);
}

.file-detail .back-link {
    display: inline-block;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
    font-size: 0.9rem;
}

.file-detail .version-history {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

.file-detail .version-history h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

/* ==========================================================================
   Detail Layout - Main + Sidebar
   ========================================================================== */

.detail-layout {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.detail-layout .file-detail {
    flex: 1;
    min-width: 0;
}

.detail-sidebar {
    width: 350px;
    flex-shrink: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-md);
}

.detail-sidebar h2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.detail-sidebar .file-list {
    border: none;
    background: none;
}

.detail-sidebar .file-list li {
    padding: 4px var(--space-sm);
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .detail-layout {
        flex-direction: column;
    }

    .detail-layout .file-detail,
    .detail-sidebar {
        width: 100%;
    }
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.empty-state::before {
    content: "📂";
    display: block;
    font-size: 2rem;
    margin-bottom: var(--space-sm);
    opacity: 0.6;
}

/* ==========================================================================
   Forms - Windows Dialog Style
   ========================================================================== */

.form-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    max-width: 800px;
}

.form-container h1 {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.form-container p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.form-container p strong {
    color: var(--color-text);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-group .hint {
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* Text Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.1s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* File Input */
.form-group input[type="file"] {
    font-family: inherit;
    font-size: 0.9rem;
    padding: var(--space-sm);
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    width: 100%;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: var(--color-primary);
    background: var(--color-hover-bg);
}

/* Rich Text Area (Trix) */
.form-group trix-editor {
    min-height: 150px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.form-group trix-toolbar {
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--color-bg);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

/* Submit Button */
.form-actions input[type="submit"],
.form-actions button[type="submit"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    transition: all 0.1s ease;
}

.form-actions input[type="submit"]:hover,
.form-actions button[type="submit"]:hover,
.btn:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-hover-bg);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Error Messages */
.form-errors {
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: #dc2626;
}

.form-errors h2 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 var(--space-sm) 0;
    color: #dc2626;
}

.form-errors ul {
    margin: 0;
    padding-left: var(--space-md);
}

.form-errors li {
    font-size: 0.85rem;
    margin-bottom: var(--space-xs);
}

.form-errors li:last-child {
    margin-bottom: 0;
}

/* Back Link */
.form-container .back-link {
    display: inline-block;
    margin-top: var(--space-md);
    font-size: 0.9rem;
}

/* ==========================================================================
   Focus States - Windows style dotted outline
   ========================================================================== */

a:focus-visible,
button:focus-visible {
    outline: 1px dotted var(--color-text);
    outline-offset: 1px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    body {
        padding: var(--space-md);
    }

    .breadcrumbs ol {
        flex-wrap: wrap;
    }

    /* Show dropdown, hide toolbar on mobile */
    .page-header .toolbar {
        display: none;
    }

    .page-header .dropdown {
        display: block;
    }
}

@media (min-width: 641px) {

    /* Hide dropdown on desktop */
    .dropdown {
        display: none;
    }
}

/* ==========================================================================
   Upload Zone - Drag & Drop
   ========================================================================== */

.uploadzone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--color-bg);
}

.uploadzone:hover {
    border-color: var(--color-primary);
    background: var(--color-hover-bg);
}

.uploadzone--dragging {
    border-color: var(--color-primary);
    background: var(--color-selected-bg);
    border-style: solid;
}

.uploadzone-input {
    display: none;
}

.uploadzone-prompt {
    pointer-events: none;
}

.uploadzone-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-sm);
    opacity: 0.6;
}

.uploadzone-prompt p {
    color: var(--color-text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* Upload List */
.upload-list {
    margin-top: var(--space-md);
}

.upload-list:empty {
    display: none;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    font-size: 0.85rem;
}

.upload-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item-size {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.upload-progress {
    width: 100px;
    height: 6px;
    background: var(--color-border-light);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.upload-progress-bar {
    height: 100%;
    width: 0;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.2s ease;
}

.upload-progress-bar--complete {
    background: #16a34a;
}

.upload-progress-bar--error {
    background: #dc2626;
}

.upload-item-status {
    color: var(--color-text-secondary);
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
    font-size: 0.8rem;
}

.upload-item--complete .upload-item-status {
    color: #16a34a;
}

.upload-item--error .upload-item-status {
    color: #dc2626;
}

.upload-item-title {
    flex: 1;
    min-width: 0;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
}

.upload-item-title:focus {
    outline: none;
    border-color: var(--color-primary);
}

.upload-item-save {
    flex-shrink: 0;
    padding: 2px 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
}

.upload-item-save:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.upload-item-save:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ==========================================================================
   Inline Edit - Rename uploads in file list
   ========================================================================== */

.inline-edit-rename {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.1s ease;
}

@media (hover: hover) {
    .file-list li:hover .inline-edit-rename {
        opacity: 1;
    }
}

.inline-edit-rename:hover {
    color: var(--color-primary);
}

.inline-edit-rename .icon {
    display: block;
}

.inline-edit-input {
    padding: 2px 6px;
    font-family: inherit;
    font-size: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
}

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

.inline-edit-input--error {
    border-color: #dc2626;
}

/* ==========================================================================
   Sortable - Drag & Drop Reordering
   ========================================================================== */

.file-list li.dragging,
.details-list tr.dragging {
    opacity: 0.4;
}

.file-list li.drag-over-top,
.details-list tr.drag-over-top {
    box-shadow: inset 0 2px 0 0 var(--color-primary);
}

.file-list li.drag-over-bottom,
.details-list tr.drag-over-bottom {
    box-shadow: inset 0 -2px 0 0 var(--color-primary);
}

/* Table row indicators need td styling since tr doesn't support box-shadow well */
.details-list tr.drag-over-top td {
    border-top: 2px solid var(--color-primary);
}

.details-list tr.drag-over-bottom td {
    border-bottom: 2px solid var(--color-primary);
}

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    margin: calc(-1 * var(--space-lg));
    margin-bottom: var(--space-md);
}

.navbar-brand a {
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.navbar-brand a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: var(--space-xs);
}

.navbar-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 12px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.1s ease;
}

.navbar-links a .icon {
    color: var(--color-text-secondary);
}

@media (hover: hover) {
    .navbar-links a:hover {
        background: var(--color-hover-bg);
        color: var(--color-text);
        text-decoration: none;
    }
}

.navbar-links a:active {
    background: var(--color-selected-bg);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

.navbar-email {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

.navbar-logout {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 0.85rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.1s ease;
}

.navbar-logout .icon {
    display: block;
}

/* Navbar User Menu */
.navbar-user-menu {
    position: relative;
    margin-left: auto;
}

.navbar-user-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.85rem;
    cursor: pointer;
    list-style: none;
    transition: all 0.1s ease;
}

.navbar-user-toggle::-webkit-details-marker {
    display: none;
}

.navbar-user-toggle::marker {
    display: none;
    content: "";
}

.navbar-user-toggle .icon {
    color: var(--color-text-secondary);
}

@media (hover: hover) {
    .navbar-user-toggle:hover {
        background: var(--color-hover-bg);
        border-color: var(--color-primary);
    }
}

.navbar-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    padding: 4px 0;
}

.navbar-user-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

@media (hover: hover) {
    .navbar-user-item:hover {
        background: var(--color-hover-bg);
        text-decoration: none;
        color: var(--color-text);
    }
}

.navbar-user-item .icon {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

@media (hover: hover) {
    .navbar-logout:hover {
        background: var(--color-hover-bg);
        border-color: var(--color-primary);
    }
}

@media (max-width: 640px) {
    .navbar {
        flex-wrap: wrap;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
        margin: calc(-1 * var(--space-md));
        margin-bottom: var(--space-md);
    }

    .navbar-brand {
        order: 1;
    }

    .navbar-user {
        order: 2;
    }

    .navbar-links {
        order: 3;
        width: 100%;
        border-top: 1px solid var(--color-border-light);
        padding-top: var(--space-sm);
        margin-top: var(--space-xs);
    }

    .navbar-email {
        display: none;
    }
}

/* ==========================================================================
   Flash Messages
   ========================================================================== */

.flash {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
}

.flash-notice {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.flash-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* ==========================================================================
   Details List - Fluent UI inspired table
   ========================================================================== */

.details-list {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.details-list thead th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.details-list thead th:first-child {
    border-top-left-radius: var(--radius);
}

.details-list thead th:last-child {
    border-top-right-radius: var(--radius);
}

.details-list tbody tr {
    transition: background-color 0.1s ease;
}

.details-list tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--color-border-light);
}

@media (hover: hover) {
    .details-list tbody tr:hover {
        background-color: var(--color-hover-bg);
    }
}

.details-list tbody td {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
    vertical-align: middle;
}

.details-list tbody td.actions {
    text-align: right;
    white-space: nowrap;
}

.details-list tbody td.actions a {
    margin-left: var(--space-sm);
    font-size: 0.85rem;
}

.details-list tbody td.actions a.danger {
    color: #dc2626;
}

.details-list tbody td.actions a.danger:hover {
    color: #b91c1c;
}

/* Badge - Fluent UI CounterBadge style */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 10px;
    line-height: 1.4;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

/* Filled (default) */
.badge {
    background: var(--color-primary);
    color: white;
}

/* Tint appearance */
.badge-tint {
    background: #e5f3ff;
    color: var(--color-primary);
}

.badge-tint-success {
    background: #dff6dd;
    color: #0e700e;
}

.badge-tint-warning {
    background: #fff4ce;
    color: #835c00;
}

.badge-tint-danger {
    background: #fde7e9;
    color: #c50f1f;
}

.badge-tint-subtle {
    background: #f0f0f0;
    color: var(--color-text-secondary);
}

/* Outline appearance */
.badge-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.badge-outline-success {
    background: transparent;
    border: 1px solid #0e700e;
    color: #0e700e;
}

.badge-outline-warning {
    background: transparent;
    border: 1px solid #835c00;
    color: #835c00;
}

.badge-outline-subtle {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

/* Text utilities */
.text-secondary {
    color: var(--color-text-secondary);
}

/* Details list link - fills entire cell for easy clicking */
.details-list-link {
    display: flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    flex: 1;
}

.details-list-link:hover {
    color: var(--color-text);
    text-decoration: none;
}

.details-list-link .icon {
    margin-right: var(--space-sm);
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

/* Make the first td use flex so link can expand */
.details-list tbody td:first-child {
    display: flex;
    align-items: center;
}

.details-list-cell {
    display: flex;
    align-items: center;
    flex: 1;
    gap: var(--space-xs);
}

.details-list-size-link {
    display: block;
    color: var(--color-text-secondary);
    text-decoration: none;
    text-align: right;
}

.details-list-size-link:hover {
    color: var(--color-text-secondary);
    text-decoration: none;
}

/* Details list cell for inline edit */
.details-list-cell {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.details-list-cell[hidden] {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.details-list-cell[hidden] input {
    display: none !important;
    visibility: hidden;
    caret-color: transparent;
}

/* ==========================================================================
   Command Bar - Fluent UI inspired
   ========================================================================== */

.command-bar {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: var(--space-md);
}

.page-header .command-bar {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0;
}

.command-bar-item {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 10px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.1s ease;
}

@media (hover: hover) {
    .command-bar-item:hover {
        background: var(--color-hover-bg);
        color: var(--color-text);
        text-decoration: none;
    }
}

.command-bar-item:active {
    background: var(--color-selected-bg);
}

.command-bar-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    color: var(--color-primary);
}

.command-bar-icon .icon {
    display: block;
}

.command-bar-separator {
    flex: 0 0 auto;
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 var(--space-xs);
}

.command-bar-form {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.command-bar-select {
    padding: 5px 8px;
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    cursor: pointer;
}

@media (hover: hover) {
    .command-bar-select:hover {
        border-color: var(--color-primary);
    }
}

.command-bar-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ==========================================================================
   Row Menu - Actions dropdown for table rows (using details/summary)
   ========================================================================== */

.row-actions {
    width: 40px;
    text-align: center;
}

.row-menu {
    position: relative;
    display: inline-block;
}

.row-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.1s ease;
    list-style: none;
}

/* Hide default marker */
.row-menu-toggle::-webkit-details-marker {
    display: none;
}

.row-menu-toggle::marker {
    display: none;
    content: "";
}

@media (hover: hover) {
    .row-menu-toggle:hover {
        background: var(--color-hover-bg);
        border-color: var(--color-border);
        color: var(--color-text);
    }
}

.row-menu-toggle:focus {
    outline: none;
    border-color: var(--color-primary);
}

.row-menu-toggle .icon {
    display: block;
}

.row-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 140px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    padding: 4px 0;
}

.row-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

@media (hover: hover) {
    .row-menu-item:hover {
        background: var(--color-hover-bg);
    }
}

.row-menu-item .icon {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.row-menu-item--danger {
    color: #dc2626;
}

.row-menu-item--danger .icon {
    color: #dc2626;
}

/* ==========================================================================
   Spreadsheet - Excel-like Grid
   ========================================================================== */

.spreadsheet-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.spreadsheet {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Column widths */
.spreadsheet-col-title {
    width: 40%;
}

.spreadsheet-col-year {
    width: 80px;
}

.spreadsheet-col-media {
    width: 120px;
}

.spreadsheet-col-retention {
    width: auto;
}

/* Header - Excel style */
.spreadsheet thead th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border-light);
    padding: 6px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-align: left;
    user-select: none;
}

.spreadsheet thead th:last-child {
    border-right: none;
}

/* Cells */
.spreadsheet tbody td {
    border-bottom: 1px solid var(--color-border-light);
    border-right: 1px solid var(--color-border-light);
    padding: 0;
    height: 32px;
    vertical-align: middle;
    position: relative;
}

.spreadsheet tbody td:last-child {
    border-right: none;
}

.spreadsheet tbody tr:last-child td {
    border-bottom: none;
}

/* Cell with link icon */
.spreadsheet tbody td:first-child {
    display: flex;
    align-items: center;
}

/* Link to artifact detail */
.spreadsheet-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
    border-right: 1px solid var(--color-border-light);
}

.spreadsheet-link:hover {
    background: var(--color-hover-bg);
    color: var(--color-primary);
}

.spreadsheet-link .icon {
    width: 14px;
    height: 14px;
}

/* Inputs - borderless until focused */
.spreadsheet-input {
    width: 100%;
    height: 100%;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 0.875rem;
    border: none;
    background: transparent;
    color: var(--color-text);
    box-sizing: border-box;
}

.spreadsheet-input:focus {
    outline: none;
    background: var(--color-surface);
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.spreadsheet-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.6;
}

/* Number input - right align */
.spreadsheet-input-number {
    text-align: right;
    -moz-appearance: textfield;
}

.spreadsheet-input-number::-webkit-outer-spin-button,
.spreadsheet-input-number::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Select styling */
select.spreadsheet-input {
    cursor: pointer;
    padding-right: 24px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* Row states */
.spreadsheet tbody tr.selected {
    background: var(--color-selected-bg);
}

.spreadsheet tbody tr.selected td {
    border-bottom-color: var(--color-selected-border);
}

.spreadsheet tbody tr.dirty {
    background: #fffbeb;
}

.spreadsheet tbody tr.saving {
    background: #fef3c7;
}

.spreadsheet tbody tr.saving .spreadsheet-input {
    color: var(--color-text-secondary);
}

.spreadsheet tbody tr.saved {
    animation: flash-save 0.5s ease;
}

@keyframes flash-save {
    0% { background: #d1fae5; }
    100% { background: transparent; }
}

.spreadsheet tbody tr.error {
    background: #fef2f2;
}

.spreadsheet tbody tr.error .spreadsheet-input {
    color: #dc2626;
}

/* New row - slightly different styling */
.spreadsheet tbody tr.new-row {
    background: #fafafa;
}

.spreadsheet tbody tr.new-row td:first-child {
    padding-left: 8px;
}

.spreadsheet tbody tr.new-row .spreadsheet-input::placeholder {
    font-style: italic;
}

/* Keyboard hint */
.spreadsheet-hint {
    padding: 8px 12px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border-light);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.spreadsheet-hint kbd {
    display: inline-block;
    padding: 2px 5px;
    font-family: inherit;
    font-size: 0.7rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--color-border);
}

/* Warning text for expired retention */
.text-warning {
    color: #b45309;
}

/* Retention cell layout */
.spreadsheet td:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

.spreadsheet td:last-child select.spreadsheet-input {
    flex: 1;
    min-width: 0;
}

/* Retention expired indicator */
.spreadsheet td.retention-expired {
    background: #fef2f2;
}

.spreadsheet td.retention-expired select {
    color: #dc2626;
}

.retention-expired-badge {
    flex-shrink: 0;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: #dc2626;
    color: white;
    border-radius: 3px;
    white-space: nowrap;
}

/* ==========================================================================
   Artifact Page
   ========================================================================== */

.artifact-page {
    max-width: none;
}

.artifact-sidebar-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-lg);
    align-items: start;
}

.artifact-sidebar-layout .artifact-main {
    min-width: 0;
}

.artifact-sidebar {
    position: sticky;
    top: var(--space-lg);
}

.artifact-sidebar .comments-section {
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.artifact-sidebar .comments-section #comments {
    flex: 1;
    overflow-y: auto;
}

@media (max-width: 960px) {
    .artifact-sidebar-layout {
        grid-template-columns: 1fr;
    }

    .artifact-sidebar {
        position: static;
    }

    .artifact-sidebar .comments-section {
        max-height: none;
    }
}

.artifact-header {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.artifact-header h1 {
    margin: 0 0 var(--space-xs) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.artifact-header h1 .icon {
    color: var(--color-text-secondary);
}

.artifact-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.artifact-meta strong {
    color: var(--color-text);
}

.artifact-actions {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

.artifact-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.artifact-actions .btn .icon {
    width: 14px;
    height: 14px;
}

/* Artifact Details Card */
.artifact-details-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.artifact-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.artifact-detail-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.artifact-detail-item-wide {
    grid-column: span 2;
}

.artifact-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

.artifact-detail-value {
    font-size: 0.95rem;
    color: var(--color-text);
}

.artifact-retention-duration {
    color: var(--color-text-secondary);
}

.artifact-retention-expired {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.artifact-retention-expired .icon {
    width: 14px;
    height: 14px;
}

.artifact-retention-active {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* Artifact Notes */
.artifact-notes {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.artifact-notes h3 {
    margin: 0 0 var(--space-sm) 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.artifact-notes-content {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Artifact Back Link */
.artifact-back-link {
    margin-bottom: var(--space-lg);
}

.artifact-back-link a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
}

.artifact-back-link .icon {
    width: 14px;
    height: 14px;
}

/* Artifact Comments */
.artifact-comments {
    margin-top: var(--space-lg);
}

/* ==========================================================================
   Comments Section
   ========================================================================== */

.comments-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.comments-section h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
}

.comments-section h2 .icon {
    color: var(--color-text-secondary);
}

.comments-section #comments {
    min-height: 80px;
}

.comments-section .empty-state {
    margin: 0;
    padding: var(--space-xl);
    border: none;
    border-radius: 0;
    background: transparent;
}

/* Individual Comment */
.comment {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.comment-header strong {
    font-size: 0.9rem;
}

.comment-header .text-secondary {
    font-size: 0.8rem;
}

.comment-body {
    font-size: 0.9rem;
    line-height: 1.5;
}

.comment-body p {
    margin: 0 0 var(--space-sm) 0;
}

.comment-body p:last-child {
    margin-bottom: 0;
}

.comment-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-light);
}

.comment-actions a,
.comment-actions button {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.comment-actions a:hover,
.comment-actions button:hover {
    color: var(--color-primary);
}

/* Comment Form */
.comment-form {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border-light);
}

.comment-form .form-group {
    margin-bottom: var(--space-sm);
}

.comment-form trix-editor {
    min-height: 80px;
    font-size: 0.9rem;
}

.comment-form .form-actions {
    border-top: none;
    padding-top: 0;
    margin-top: var(--space-sm);
}

@media (max-width: 640px) {
    .artifact-detail-grid {
        grid-template-columns: 1fr;
    }

    .artifact-detail-item-wide {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Tile Grid - Windows Explorer inspired tiles
   ========================================================================== */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.1s ease;
    cursor: pointer;
}

@media (hover: hover) {
    .tile:hover {
        background: var(--color-hover-bg);
        border-color: var(--color-primary);
        text-decoration: none;
        color: var(--color-text);
    }
}

.tile:active {
    background: var(--color-selected-bg);
    border-color: var(--color-selected-border);
}

.tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}

.tile-icon .icon {
    width: 48px;
    height: 48px;
}

.tile-title {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    word-break: break-word;
}

.tile-meta {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
    text-align: center;
}

@media (max-width: 480px) {
    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .tile {
        padding: var(--space-md);
    }

    .tile-icon {
        width: 36px;
        height: 36px;
    }

    .tile-icon .icon {
        width: 36px;
        height: 36px;
    }
}