/* === Base === */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #b71c1c;
    min-height: 100vh;
}

/* === Site Header === */
.site-header {
    background: #000;
    color: #fff;
    padding: 20px 40px;
    text-align: center;
    border-bottom: 1px solid #333;
}
.site-header h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .35em;
    text-transform: uppercase;
}
.site-header .subtitle {
    margin: 6px 0 0;
    font-size: 10px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #888;
}

/* === Content Wrapper === */
.content-wrapper {
    max-width: 720px;
    margin: 40px auto;
    background: #fff;
    padding: 48px;
    border-radius: 0;
}
@media (max-width: 760px) {
    .content-wrapper {
        margin: 20px;
        padding: 28px;
    }
}

/* === Typography === */
h1.page-title {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: .15em;
    text-transform: uppercase;
    margin: 0 0 8px;
    text-align: center;
}
p.page-subtitle {
    color: #666;
    text-align: center;
    margin: 0 0 40px;
    font-size: 14px;
}

/* === Forms === */
.form-group { margin-bottom: 24px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    letter-spacing: .02em;
}
.required { color: #b71c1c; }

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 15px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color .15s;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #000;
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 12px; color: #888; margin-top: 6px; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: #000; color: #fff; }
.btn-secondary { background: #eee; color: #333; }
.btn-danger { background: #fee2e2; color: #b71c1c; }
.btn-sm { padding: 8px 14px; font-size: 12px; }

/* === Drop Zone === */
.drop-zone {
    border: 2px dashed #ddd;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all .15s;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: #000;
    background: #f5f5f5;
}
.drop-zone svg { color: #bbb; margin-bottom: 16px; }
.drop-zone p { margin: 4px 0; font-size: 14px; }
.drop-zone .hint { font-size: 12px; color: #999; }
.drop-zone.has-file { border-color: #16a34a; background: #f0fdf4; }

.file-preview {
    padding: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    text-align: left;
}
.file-preview.hidden { display: none; }
.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.file-info strong { flex: 1; }
.btn-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
}
.btn-remove:hover { color: #b71c1c; }

/* === Alerts === */
.alert {
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    border-left: 3px solid;
}
.alert-error { background: #fee2e2; color: #991b1b; border-color: #b71c1c; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #3b82f6; }

/* === Success === */
.success-box {
    text-align: center;
    padding: 60px 40px;
}
.success-box h2 { color: #16a34a; font-weight: 300; letter-spacing: .1em; text-transform: uppercase; }
.quality-result { margin: 24px 0; padding: 20px; font-size: 14px; }
.quality-result.ok { background: #f0fdf4; color: #166534; }
.quality-result.rework { background: #fffbeb; color: #92400e; }

/* === Login === */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}
.login-box {
    background: #fff;
    padding: 48px;
    width: 100%;
    max-width: 420px;
}
.login-box h1 { text-align: center; font-weight: 300; letter-spacing: .15em; text-transform: uppercase; margin-bottom: 32px; }

/* === Admin === */
.admin-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    padding: 40px;
}
@media (max-width: 1240px) {
    .admin-wrapper { margin: 20px; padding: 24px; }
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.admin-header h1 { margin: 0; font-weight: 300; letter-spacing: .1em; text-transform: uppercase; font-size: 24px; }

.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}
.stat {
    background: #fafafa;
    padding: 20px 28px;
    text-align: center;
    min-width: 120px;
    border: 1px solid #eee;
}
.stat-num { display: block; font-size: 36px; font-weight: 300; font-variant-numeric: tabular-nums; }
.stat-ok { color: #16a34a; }
.stat-warn { color: #d97706; }
.stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

/* === Toolbar === */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px 10px 38px;
    border: 1px solid #ddd;
    font-size: 14px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
}
.filter-select { min-width: 140px; padding: 10px 12px; border: 1px solid #ddd; font-size: 14px; background: #fff; }
.view-toggle { display: flex; gap: 4px; }
.view-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all .15s;
}
.view-btn:hover { border-color: #000; color: #000; }
.view-btn.active { background: #000; color: #fff; border-color: #000; }

/* === Settings Panel === */
.settings-panel { border: 1px solid #eee; margin-bottom: 28px; }
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: #fafafa;
    transition: background .15s;
}
.settings-header:hover { background: #f5f5f5; }
.settings-header h3 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.settings-toggle { font-size: 12px; color: #666; }
.settings-body { padding: 24px; }
.settings-body.hidden { display: none; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.settings-col h4 { font-size: 13px; font-weight: 500; margin: 0 0 16px; text-transform: uppercase; letter-spacing: .05em; color: #333; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; cursor: pointer; font-size: 14px; }
.toggle-row input { width: 18px; height: 18px; accent-color: #000; cursor: pointer; }
.settings-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.settings-status { font-size: 13px; font-weight: 500; }

/* === Gallery === */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card {
    background: #fff;
    border: 1px solid #eee;
    overflow: hidden;
    transition: box-shadow .15s;
    position: relative;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.card-thumb {
    height: 160px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.file-icon { font-size: 40px; color: #ccc; }
.quality-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    border: 1px solid #eee;
}
.quality-badge.ok { color: #16a34a; }
.quality-badge.review, .quality-badge.rework { color: #d97706; }
.card-body { padding: 16px; }
.card-title { font-size: 15px; font-weight: 500; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-artist { font-size: 13px; color: #666; margin: 0 0 10px; }
.card-email { font-size: 11px; color: #999; display: block; margin-top: 2px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: #999; margin-bottom: 10px; }
.card-actions { display: flex; gap: 6px; }

.gallery-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0;
    transition: opacity .15s;
}
.card:hover .gallery-actions { opacity: 1; }
.gallery-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    font-size: 16px;
}
.gallery-actions button:hover { color: #b71c1c; }

/* === Tags === */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
    cursor: pointer;
}
.tag:hover { opacity: .8; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-orange { background: #ffedd5; color: #9a3412; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-purple { background: #f3e8ff; color: #6b21a8; }
.tag-remove { background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 0 0 4px; color: inherit; opacity: .6; }
.tag-remove:hover { opacity: 1; }

/* === List Table === */
.list-table { width: 100%; border-collapse: collapse; border: 1px solid #eee; }
.list-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.list-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.list-table tr:hover { background: #fafafa; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; }
.status-dot.ok { background: #16a34a; }
.status-dot.review, .status-dot.rework { background: #d97706; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.row-actions { opacity: 0; transition: opacity .15s; }
.list-table tr:hover .row-actions { opacity: 1; }
.row-actions button { padding: 4px 8px; border: none; background: none; cursor: pointer; color: #bbb; border-radius: 0; font-size: 13px; }
.row-actions button:hover { background: #f5f5f5; color: #1a1a1a; }

/* === List Thumbnails === */
.list-thumb { width: 60px; height: 60px; padding: 4px !important; vertical-align: middle; }
.list-thumb img { width: 52px; height: 52px; object-fit: cover; display: block; }
.file-icon-sm { font-size: 24px; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: #f5f5f5; }
.text-muted { color: #bbb; font-size: 12px; }

/* === Modal === */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-content {
    position: relative;
    background: #fff;
    padding: 32px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; min-height: 32px; }
.tag-add-row { display: flex; gap: 8px; margin-bottom: 16px; }
.tag-add-row input { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; }

/* === Empty / Loading === */
.empty-state { text-align: center; padding: 60px 20px; color: #bbb; font-size: 15px; }
.loading { text-align: center; padding: 40px; color: #666; }

/* === Responsive === */
@media (max-width: 640px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-input, .filter-select { width: 100%; }
    .stats-bar { flex-direction: column; }
    .gallery { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .content-wrapper { padding: 24px; margin: 12px; }
    .admin-wrapper { padding: 20px; margin: 12px; }
}

/* === Bulk Actions === */
.bulk-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #eee;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.bulk-bar.hidden { display: none; }
.bulk-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.bulk-select-all input { width: 18px; height: 18px; accent-color: #000; cursor: pointer; }
.bulk-count { font-size: 13px; color: #666; }
.bulk-actions { display: flex; gap: 8px; margin-left: auto; }

/* Card checkbox */
.card-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}
.card-select input {
    width: 20px;
    height: 20px;
    accent-color: #000;
    cursor: pointer;
}

/* List checkbox */
.list-select { width: 30px; text-align: center; padding: 14px 4px !important; }
.list-select input { width: 18px; height: 18px; accent-color: #000; cursor: pointer; }

/* Tag mode radio */
.tag-mode { display: flex; gap: 16px; margin-bottom: 16px; font-size: 14px; }
.tag-mode label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tag-mode input { width: 16px; height: 16px; accent-color: #000; }
