/* ═══════════════════════════════════════════════
   Prestige Inventory — Minimalist Luxury Theme
   Clean · Professional · Understated
   ═══════════════════════════════════════════════ */

:root {
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-sidebar: #1a1a1a;
    --bg-hover: #f5f5f5;
    --bg-input: #ffffff;
    --border: #e8e8e8;
    --border-light: #f0f0f0;
    --text: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --text-on-dark: #e0e0e0;
    --text-on-dark-muted: #8a8a8a;
    --accent: #b8956a;
    --accent-hover: #a67e52;
    --accent-light: #f7f3ee;
    --accent-bg: rgba(184, 149, 106, 0.08);
    --success: #5b8a72;
    --warning: #c4944a;
    --danger: #b85450;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
    --sidebar-w: 230px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --transition: 0.18s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ─── Sidebar ─── */

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-header {
    padding: 24px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header i {
    color: var(--accent);
    font-size: 1.1rem;
}

.sidebar-header span {
    color: var(--text-on-dark);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-on-dark-muted);
    font-size: 1.1rem;
    margin-left: auto;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--text-on-dark-muted);
    font-size: 0.85rem;
    font-weight: 400;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.nav-links li a:hover {
    color: var(--text-on-dark);
    background: rgba(255,255,255,0.03);
}

.nav-links li a.active {
    color: var(--text-on-dark);
    background: rgba(184, 149, 106, 0.08);
    border-left-color: var(--accent);
}

.nav-links li a i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

.nav-links li a.active i { opacity: 1; color: var(--accent); }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-footer a {
    color: var(--text-on-dark-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    transition: color var(--transition);
}

.sidebar-footer a:hover { color: var(--text-on-dark); }

.user-info {
    font-size: 0.75rem;
    color: var(--text-on-dark-muted);
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.04);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Main Content ─── */

.main-content {
    margin-left: var(--sidebar-w);
    padding: 32px 40px;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ─── Page Header ─── */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Buttons ─── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    border-color: #d0d0d0;
    color: var(--text);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover { background: #a04a46; color: #fff; }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Table Scroll (mobile) ─── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 100%; }
.table-scroll .table { min-width: 320px; width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Stats Grid ─── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card.money { border-color: rgba(184, 149, 106, 0.25); }

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.5px;
}

.stat-card.money .stat-value { color: var(--accent); }

/* ─── Stats Bar (inline) ─── */

.stats-bar {
    display: flex;
    gap: 24px;
    padding: 14px 0;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.stats-bar strong {
    color: var(--text);
    font-weight: 600;
}

/* ─── Breadcrumb ─── */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 20px;
    font-size: 0.82rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); opacity: 0.5; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ─── Page Controls ─── */

.page-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.control-left { display: flex; gap: 8px; align-items: center; }

.control-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ─── Search Box ─── */

.search-box {
    position: relative;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.82rem;
    transition: border-color var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-box input::placeholder { color: var(--text-muted); }

/* ─── Inline Forms ─── */

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
    padding: 7px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.82rem;
}

.inline-form input:focus,
.inline-form select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ─── Select / Input ─── */

select, input[type="text"], input[type="number"], input[type="password"], input[type="date"], textarea {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font);
    transition: border-color var(--transition);
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

select { cursor: pointer; }

/* ─── Items Grid ─── */

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
}

.items-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.item-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    color: var(--text);
    display: block;
    text-decoration: none;
    min-width: 0;
}

.item-card:hover {
    border-color: #d0d0d0;
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.item-card-image {
    height: 170px;
    overflow: hidden;
    background: #f5f5f5;
}

.items-grid.compact .item-card-image { height: 130px; }

.item-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 1.8rem;
}

.item-card-body {
    padding: 12px 14px;
}

.item-card-body h4 {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.item-card-meta .price {
    color: var(--accent);
    font-weight: 600;
}

.item-card-meta .qty { color: var(--text-secondary); }

.item-card-tags {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ─── Tag Pills ─── */

.tag-pill {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
}

.tag-pill.more { background: #f0f0f0; color: var(--text-muted); }

/* ─── Folders Grid ─── */

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.folder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
    color: var(--text);
}

.folder-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.folder-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.folder-icon i { color: var(--accent); font-size: 1.1rem; }

.folder-info { flex: 1; min-width: 0; }

.folder-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.folder-info p {
    font-size: 0.76rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Dashboard Sections ─── */

.dashboard-section {
    margin-bottom: 28px;
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 8px;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.link {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

/* ─── Activity Feed ─── */

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-avatar i { color: var(--accent); font-size: 0.7rem; }

.activity-body { flex: 1; }

.activity-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

.activity-body p strong { color: var(--text); font-weight: 600; }

.activity-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* ─── Forms ─── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font);
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea { resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ─── Detail Layout ─── */

.detail-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
    margin-top: 8px;
}

.detail-left { display: flex; flex-direction: column; gap: 16px; }
.detail-right { display: flex; flex-direction: column; gap: 20px; }

.photo-gallery { display: flex; flex-direction: column; gap: 8px; }

.photo-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.photo-item.primary { border: 2px solid var(--accent); }

.photo-item img { width: 100%; display: block; }

.photo-actions {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.photo-item:hover .photo-actions { opacity: 1; }

.photo-actions .btn {
    padding: 3px 8px;
    font-size: 0.7rem;
}

.detail-info {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    gap: 16px;
}

.info-row:last-child { border-bottom: none; }

.info-label {
    width: 130px;
    color: var(--text-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
    font-weight: 500;
}

.info-value { font-weight: 500; color: var(--text); font-size: 0.85rem; word-break: break-all; overflow-wrap: anywhere; }

.checkout-section,
.detail-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
}

.checkout-section h3,
.detail-section h3 {
    margin: 0 0 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ─── Form Layout ─── */

.form-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-top: 8px;
}

.form-main, .form-side {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
}

.form-side { display: flex; flex-direction: column; gap: 14px; }

.custom-fields-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.custom-fields-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-input {
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #fafafa;
}

/* ─── Tags Layout ─── */

.tags-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin-top: 8px;
}

.tags-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 14px;
    border: 1px solid var(--border);
}

.tag-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 12px;
    max-height: 70vh;
    overflow-y: auto;
}

.tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    transition: all var(--transition);
}

.tag-row:hover { background: var(--accent-light); color: var(--text); }

.tag-row .fa-tag { color: var(--text-muted); font-size: 0.7rem; }

.tag-count {
    margin-left: auto;
    background: #f0f0f0;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.tags-main {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border);
}

/* ─── Settings Layout ─── */

.settings-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 28px;
    margin-top: 8px;
}

.settings-nav { display: flex; flex-direction: column; gap: 2px; }

.settings-nav a {
    padding: 8px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    transition: all var(--transition);
}

.settings-nav a.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.settings-nav a:hover { background: var(--bg-hover); color: var(--text); }

.settings-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.settings-section h2 { font-size: 1rem; font-weight: 600; margin: 0 0 18px; }

/* ─── Import Steps ─── */

.import-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
}

.import-step {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--border);
}

.import-step h3 { font-size: 0.9rem; font-weight: 600; margin: 0 0 8px; }
.import-step p { color: var(--text-muted); font-size: 0.82rem; margin: 0 0 12px; }

/* ─── Table ─── */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    table-layout: auto;
}

.table th {
    text-align: left;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    vertical-align: middle;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
    word-break: break-word;
}

.table tr:hover td { background: #fafafa; }
.table a { color: var(--accent); text-decoration: none; }
.table td form { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.table td .btn { margin: 2px; }

/* ─── Modal ─── */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.modal-content h3 { margin-bottom: 14px; font-size: 1rem; font-weight: 600; }
.modal-content p { margin-bottom: 16px; color: var(--text-muted); font-size: 0.85rem; }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ─── Alerts ─── */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.alert-success { background: rgba(91, 138, 114, 0.1); color: var(--success); border: 1px solid rgba(91, 138, 114, 0.2); }
.alert-error { background: rgba(184, 84, 80, 0.08); color: var(--danger); border: 1px solid rgba(184, 84, 80, 0.2); }
.alert-warning { background: rgba(196, 148, 74, 0.1); color: var(--warning); border: 1px solid rgba(196, 148, 74, 0.2); }

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    opacity: 0.6;
}

.alert-close:hover { opacity: 1; }

/* ─── Empty States ─── */

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 16px;
    font-size: 0.85rem;
}

.empty-state-large {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-large i { font-size: 2.5rem; margin-bottom: 16px; display: block; opacity: 0.3; }
.empty-state-large h3 { margin-bottom: 8px; color: var(--text); font-size: 1rem; font-weight: 500; }
.empty-state-large p { font-size: 0.85rem; }
.empty-state-large a { color: var(--accent); }

/* ─── Pagination ─── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ─── Login ─── */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-sidebar);
}

.login-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 44px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo i {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 12px;
    display: block;
}

.login-card h1 {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.login-card .text-muted {
    text-align: center;
    display: block;
    margin-bottom: 28px;
    font-size: 0.82rem;
}

.login-card form .btn-block { margin-top: 12px; }

/* ─── Utilities ─── */

.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

/* ─── Folder Tree ─── */

.folder-tree {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.folder-tree-item {
    border-bottom: 1px solid var(--border-light);
}

.folder-tree-item:last-child { border-bottom: none; }

.folder-tree-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.folder-tree-link:hover { background: var(--accent-light); color: var(--text); }
.folder-tree-link i { color: var(--accent); font-size: 0.85rem; }

/* ─── Mobile ─── */

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-sidebar);
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 90;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-on-dark);
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--accent);
    font-size: 0.85rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

@media (max-width: 768px) {
    .mobile-header { display: flex; }
    .sidebar { transform: translateX(-100%); width: 270px; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay { display: block; }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; padding: 60px 14px 24px; }

    /* Page headers stack */
    .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .page-header h1 { font-size: 1.15rem; }
    .page-header-actions { width: 100%; display: flex; gap: 8px; }
    .page-header-actions .btn { flex: 1; justify-content: center; }

    /* Controls stack */
    .page-controls { flex-direction: column; align-items: stretch; gap: 10px; }
    .control-left { flex-direction: column; gap: 8px; }
    .control-left .btn { width: 100%; justify-content: center; }
    .control-right { flex-direction: column; gap: 8px; }
    .control-right .search-box { width: 100%; }
    .control-right select { width: 100%; }
    .control-right .link { text-align: center; }

    /* Stats grid 2-col */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: 0.65rem; }

    /* Stats bar wraps */
    .stats-bar { gap: 10px; font-size: 0.75rem; flex-wrap: wrap; }

    /* All grid layouts stack to 1 col */
    .detail-layout, .form-layout, .tags-layout, .settings-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Detail page */
    .detail-left { order: 1; }
    .detail-right { order: 2; }
    .info-row { flex-direction: column; gap: 2px; padding: 8px 0; }
    .info-label { width: auto; min-width: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3px; }
    .info-value { font-size: 0.82rem; word-break: break-all; overflow-wrap: anywhere; }
    .photo-item img { max-height: 260px; object-fit: cover; }
    .detail-info, .checkout-section, .detail-section { padding: 14px; }

    /* Form layout */
    .form-main, .form-side { padding: 16px; }
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .form-group { margin-bottom: 12px; }
    .form-group label { font-size: 0.72rem; }
    .form-group input, .form-group select, .form-group textarea { font-size: 0.82rem; padding: 8px 10px; }

    /* Items grid 2-col */
    .items-grid, .items-grid.compact { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .item-card { min-width: 0; overflow: hidden; }
    .item-card-image { height: 110px; }
    .items-grid.compact .item-card-image { height: 100px; }
    .item-card-body { padding: 8px 10px; }
    .item-card-body h4 { font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .item-card-meta { font-size: 0.72rem; flex-wrap: wrap; gap: 4px; }
    .item-card-meta .price { white-space: nowrap; }

    /* Folders 1-col */
    .folders-grid { grid-template-columns: 1fr; }
    .folder-card { min-width: 0; }

    /* Tags layout */
    .tags-sidebar { padding: 10px; }
    .tags-main { padding: 16px; }

    /* Settings layout */
    .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .settings-nav a { padding: 6px 10px; font-size: 0.78rem; }
    .settings-section { padding: 16px; }
    .settings-section h2 { font-size: 0.9rem; }
    .inline-form { flex-direction: column; align-items: stretch; gap: 8px; }
    .inline-form input, .inline-form select { width: 100%; }
    .inline-form .btn { width: 100%; justify-content: center; }

    /* Import steps */
    .import-steps { gap: 12px; }
    .import-step { padding: 16px; }

    /* Login */
    .login-card { padding: 28px 20px; margin: 16px; }

    /* Breadcrumb */
    .breadcrumb { padding: 6px 0 12px; font-size: 0.75rem; flex-wrap: wrap; }

    /* Activity feed */
    .activity-item { padding: 8px 0; }
    .activity-body p { font-size: 0.78rem; }
    .activity-avatar { width: 26px; height: 26px; }

    /* Section headers */
    .section-header h2 { font-size: 0.9rem; }
    .dashboard-section { margin-bottom: 20px; }

    /* Table font smaller */
    .table { font-size: 0.75rem; }
    .table th, .table td { padding: 7px 8px; }
    .table th { font-size: 0.65rem; }
    .table-scroll { margin: 0 -14px; padding: 0 14px; }
    .table-scroll .table { min-width: 280px; }
}

@media (max-width: 480px) {
    .items-grid, .items-grid.compact { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 1rem; }
    .page-header h1 { font-size: 1.05rem; }
    .item-card-image { height: 140px; }
    .main-content { padding: 56px 12px 20px; }
}

/* ─── Scrollbar ─── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }

/* ─── Advanced Search ─── */
.adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.adv-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.adv-sort {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.cf-pair {
    display: flex;
    gap: 6px;
}
.cf-pair select { flex: 1; min-width: 0; }
.cf-pair input { flex: 1; min-width: 0; }

/* ─── Card ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
}

/* ─── Tables (report) ─── */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    word-break: break-word;
}
.table tr:hover td { background: #fafafa; }
.table a { color: var(--accent); text-decoration: none; }
.table a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-success { color: #2e7d32 !important; }
.text-danger { color: #c62828 !important; }

/* ─── Badge ─── */
.badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent-hover);
    border: 1px solid rgba(184, 149, 106, 0.3);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
}


/* ─── Report Types ─── */
.report-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}
.report-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    min-width: 0;
}
.report-type-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}
.report-type-card i {
    font-size: 1.4rem;
    color: var(--accent);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: 8px;
    flex-shrink: 0;
}
.report-type-card strong { display: block; margin-bottom: 2px; }
.report-type-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}
@media (max-width: 480px) {
    .report-types { grid-template-columns: 1fr; }
}
/* ─── Workflows ─────────────────────────────────────────────── */
.workflow-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;margin:18px 0}
.workflow-card{display:flex;align-items:center;gap:14px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;text-decoration:none;color:var(--text);box-shadow:var(--shadow);transition:var(--transition)}
.workflow-card:hover{box-shadow:var(--shadow-hover);transform:translateY(-2px)}
.workflow-icon{width:46px;height:46px;border-radius:12px;background:var(--accent-light);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0}
.workflow-card h2{font-size:1rem;margin:0 0 2px}
.workflow-card p{margin:0;font-size:.82rem;color:var(--text-secondary)}
.workflow-count{display:block;margin-top:6px;font-size:.75rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}
.workflow-arrow{margin-left:auto;color:var(--text-muted)}
.workflow-dialog{border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px;min-width:320px;max-width:90vw;box-shadow:0 10px 40px rgba(0,0,0,.18)}
.workflow-dialog::backdrop{background:rgba(0,0,0,.45)}
.workflow-dialog label{display:block;margin:10px 0;font-size:.82rem;font-weight:600;color:var(--text-secondary)}
.workflow-dialog input,.workflow-dialog textarea,.workflow-dialog select{width:100%;margin-top:4px;padding:9px 10px;border:1px solid var(--border);border-radius:var(--radius);font:inherit}
.dialog-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}
.filters-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;margin-bottom:14px}
.filters-bar input,.filters-bar select{padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius);font:inherit}


/* ─── Mobile overflow fixes (long selects must not force grid columns wide) ─── */
.adv-grid > .form-group { min-width: 0; }
.adv-grid input, .adv-grid select { width: 100%; max-width: 100%; min-width: 0; }
.cf-pair select, .cf-pair input { width: 100%; max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }

/* Touch devices: photo actions can't rely on hover */
@media (hover: none), (max-width: 768px) {
    .photo-actions { opacity: 1; position: static; padding: 6px; justify-content: flex-end; }
}

/* Phone: advanced search is a single column, filters-bar stacks */
@media (max-width: 768px) {
    .adv-grid { grid-template-columns: 1fr; gap: 10px; }
    .adv-grid .form-group { min-width: 0; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filters-bar input, .filters-bar select { width: 100%; }
    .workflow-dialog { min-width: 0; width: 92vw; }
}

/* ─── Accessibility ─────────────────────────────── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 0 0 6px 0;
    font-size: 0.85rem;
}
.skip-link:focus { left: 0; }
.main-content:focus { outline: none; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Honour reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Larger tap targets for interactive controls on touch */
@media (max-width: 768px) {
    .btn, .nav-links li a { min-height: 44px; }
    .table td .btn { min-height: 36px; }
}
