:root {
    --nav: #eef8ff;
    --green: #1677a8;
    --lime: #dff3ff;
    --ink: #13263b;
    --muted: #6c7d8e;
    --line: #dbe8f1;
    --bg: #f6f9fc;
}

body {
    background: var(--bg);
    color: var(--ink);
}

.shell aside {
    background: linear-gradient(180deg, #f8fcff 0%, #e8f5fd 100%);
    color: #17324b;
    border-right: 1px solid #d2e6f2;
    box-shadow: 8px 0 30px rgba(32, 85, 116, 0.05);
}

.brand img {
    width: 194px;
    filter: none;
}

.club small,
.shell aside .kicker {
    color: #6c8da3;
}

.shell nav a {
    color: #526f82;
    font-weight: 600;
}

.shell nav a.active,
.shell nav a:hover {
    background: #ffffff;
    color: #126b99;
    box-shadow: 0 5px 18px rgba(38, 105, 143, 0.09), inset 3px 0 0 #59b9e8;
}

.shell aside form button {
    color: #587589;
}

.stats article,
.panel,
.login-card {
    border-color: var(--line);
    box-shadow: 0 12px 34px rgba(25, 65, 91, 0.06);
}

.stats article:hover,
.panel:hover {
    border-color: #c7dfed;
}

button.primary,
.primary,
.actions form button.approve,
.floating-menu {
    background: linear-gradient(135deg, #2394c9, #136f9f);
    border-color: #1677a8;
    box-shadow: 0 8px 20px rgba(22, 119, 168, 0.18);
}

.primary:hover,
.actions form button.approve:hover {
    background: linear-gradient(135deg, #1985b9, #105f8a);
}

.flash {
    background: #e6f5fc;
    color: #17678e;
    border: 1px solid #cbe8f5;
}

.status {
    background: #edf4f8;
    color: #5d7280;
}

.status-submitted {
    background: #fff3da !important;
    color: #95651c !important;
}

.status-admin_approved {
    background: #e3f4fc !important;
    color: #176f99 !important;
}

.login-page {
    background:
        radial-gradient(circle at 18% 12%, rgba(175, 225, 250, 0.55), transparent 35%),
        radial-gradient(circle at 86% 84%, rgba(210, 238, 252, 0.7), transparent 36%),
        #f7fbfe;
}

.login-card {
    backdrop-filter: blur(16px);
    border-color: rgba(207, 227, 239, 0.9);
}

.login-card input[type=email],
.login-card input[type=password] {
    background: #fbfdff;
}

.login-card input[type=email]:focus,
.login-card input[type=password]:focus {
    border-color: #55b6e2;
    outline: 3px solid rgba(85, 182, 226, 0.16);
}

@media (max-width: 800px) {
    .shell aside {
        box-shadow: 10px 0 35px rgba(30, 78, 107, 0.18);
    }

    .floating-menu {
        box-shadow: 0 9px 25px rgba(18, 105, 148, 0.30);
    }
}

.media-upload {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(360px, 1.25fr);
    gap: 36px;
    padding: 28px;
}

.media-upload-copy {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.media-upload-copy p,
.media-name p,
.media-title > span {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.media-icon {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    background: #e0f3fc;
    color: #1677a8;
    font-size: 24px;
}

.media-upload form {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 14px;
    align-items: end;
}

.media-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.media-field input {
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fbfdff;
    color: var(--ink);
}

.media-field input:focus {
    border-color: #55b6e2;
    outline: 3px solid rgba(85, 182, 226, .14);
}

.dropzone {
    min-height: 88px;
    border: 1.5px dashed #9bcbe2;
    border-radius: 11px;
    background: #f5fbfe;
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    padding: 15px;
    cursor: pointer;
}

.dropzone:hover { background: #edf8fd; border-color: #55afd7; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .upload-arrow { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #dff2fb; color: #1677a8; font-size: 18px; }
.dropzone b { align-self: end; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone small { align-self: start; color: var(--muted); }
.media-upload form .primary { min-height: 46px; grid-column: 1 / -1; cursor: pointer; }
.media-error { grid-column: 1 / -1; margin: 0; color: #b33a3a; font-size: 12px; }

.media-section { margin-top: 30px; }
.media-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.media-title > span { padding: 7px 11px; border-radius: 99px; background: #eaf4fa; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.media-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 10px 28px rgba(25,65,91,.055); }
.media-preview { position: relative; height: 190px; display: grid; place-items: center; padding: 22px; background-color: #f7fafc; background-image: linear-gradient(45deg,#edf2f5 25%,transparent 25%),linear-gradient(-45deg,#edf2f5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#edf2f5 75%),linear-gradient(-45deg,transparent 75%,#edf2f5 75%); background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }
.media-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-symbol { width: 112px; height: 126px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #ccdfeb; border-radius: 8px; background: white; box-shadow: 0 8px 18px rgba(31,74,98,.08); }
.file-symbol b { color: #1677a8; font-size: 22px; }
.file-symbol span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.quality { position: absolute; left: 12px; bottom: 12px; padding: 6px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; box-shadow: 0 3px 10px #17324b15; }
.quality-good { background: #e1f4eb; color: #247255; }
.quality-warning { background: #fff2d8; color: #90621d; }
.quality-bad { background: #fbe4e4; color: #a23c3c; }
.media-body { padding: 17px; }
.media-name h3 { margin: 0; font-size: 16px; }
.quality-notes { min-height: 72px; margin: 15px 0; padding: 12px 12px 12px 29px; border-radius: 9px; background: #f7fafc; color: #607382; font-size: 11px; line-height: 1.45; }
.quality-notes li + li { margin-top: 5px; }
.media-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf2f5; padding-top: 13px; }
.media-actions a,
.media-actions button { border: 0; background: none; color: #1677a8; font: inherit; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; }
.media-actions button { color: #a54a4a; }
.media-empty { padding: 70px 24px; border: 1px dashed #bed8e6; border-radius: 13px; background: #fbfdff; text-align: center; color: var(--muted); }
.media-empty span { display: block; color: #58acd4; font-size: 38px; }
.media-empty h3 { margin: 10px 0 0; color: var(--ink); }
.media-empty p { margin: 7px 0 0; }

@media (max-width: 1100px) {
    .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .media-upload { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .media-upload { padding: 21px; }
    .media-upload form { grid-template-columns: 1fr; }
    .media-upload form .primary { grid-column: auto; }
    .media-grid { grid-template-columns: 1fr; }
}

/* Compact motif library */
.library-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 28px 0 18px;
}

.library-head h2 { margin: 4px 0 0; }
.library-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.add-motif { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.add-motif span { font-size: 18px; line-height: 1; }

.motif-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.motif-tile {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
    box-shadow: 0 8px 24px rgba(25, 65, 91, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.motif-tile:hover {
    transform: translateY(-2px);
    border-color: #bcdbea;
    box-shadow: 0 14px 30px rgba(25, 65, 91, .10);
}

.motif-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.motif-picture {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    padding: 18px;
    background-color: #f7fafc;
    background-image: linear-gradient(45deg,#edf2f5 25%,transparent 25%),linear-gradient(-45deg,#edf2f5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#edf2f5 75%),linear-gradient(-45deg,transparent 75%,#edf2f5 75%);
    background-size: 20px 20px;
    background-position: 0 0,0 10px,10px -10px,-10px 0;
}

.motif-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.motif-caption {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 13px 14px 14px;
}

.motif-caption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.motif-caption small { margin-top: 4px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }

.quality-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(24, 52, 70, .18);
}

.quality-dot.quality-good { background: #3caa79; color: white; }
.quality-dot.quality-warning { background: #f3ad38; color: white; }
.quality-dot.quality-bad { background: #d95c5c; color: white; }

.app-dialog {
    width: min(920px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 17px;
    background: white;
    color: var(--ink);
    box-shadow: 0 28px 90px rgba(14, 40, 58, .28);
}

.app-dialog::backdrop { background: rgba(11, 29, 43, .58); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 15px; right: 15px; z-index: 4; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #dce7ee; border-radius: 50%; background: rgba(255,255,255,.92); color: #617585; font-size: 22px; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: #eff6fa; color: #18354b; }

.dialog-sheet { position: relative; display: grid; grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr); min-height: 520px; }
.asset-detail-preview { display: grid; place-items: center; min-width: 0; padding: 36px; overflow: hidden; background-color: #f7fafc; background-image: linear-gradient(45deg,#edf2f5 25%,transparent 25%),linear-gradient(-45deg,#edf2f5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#edf2f5 75%),linear-gradient(-45deg,transparent 75%,#edf2f5 75%); background-size: 22px 22px; background-position: 0 0,0 11px,11px -11px,-11px 0; }
.asset-detail-preview img { display: block; max-width: 100%; max-height: 450px; object-fit: contain; }
.asset-detail-content { min-width: 0; padding: 48px 38px 32px; }
.asset-detail-content h2 { margin-top: 13px; font-size: 25px; }
.asset-file { margin: 5px 0 22px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.detail-status { display: inline-flex; padding: 7px 10px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.asset-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.asset-facts div { padding: 12px; background: #fbfdfe; }
.asset-facts dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.asset-facts dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; }
.detail-feedback { padding: 14px; border-radius: 10px; background: #f4f8fb; font-size: 11px; line-height: 1.5; }
.detail-feedback ul { margin: 8px 0 0; padding-left: 18px; }
.detail-feedback li + li { margin-top: 5px; }
.detail-actions { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.detail-actions .primary { display: inline-flex; text-decoration: none; font-size: 12px; }
.delete-motif { padding: 0; border: 0; background: transparent; color: #a54a4a; font-size: 11px; font-weight: 700; cursor: pointer; }

.upload-dialog { width: min(520px, calc(100% - 28px)); }
.dialog-card { position: relative; padding: 34px; }
.dialog-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px; border-radius: 13px; background: #e1f3fc; color: #1677a8; font-size: 22px; }
.dialog-card h2 { margin-top: 6px; font-size: 25px; }
.dialog-intro { margin: 7px 0 25px; color: var(--muted); font-size: 13px; }
.dialog-card form { display: grid; gap: 16px; }
.dialog-card .media-field small { color: var(--muted); font-weight: 400; }
.dialog-card .dropzone { min-height: 105px; }
.upload-submit { min-height: 48px; cursor: pointer; }
.file-symbol small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.file-symbol.large { width: 130px; height: 150px; }
.media-empty .primary { margin-top: 20px; cursor: pointer; }

@media (max-width: 1100px) {
    .motif-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .motif-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .dialog-sheet { grid-template-columns: 1fr; }
    .asset-detail-preview { min-height: 280px; }
    .asset-detail-content { padding: 30px 22px 24px; }
}

@media (max-width: 480px) {
    .library-head { align-items: flex-start; }
    .add-motif { width: 46px; height: 46px; justify-content: center; padding: 0; border-radius: 50%; font-size: 0; }
    .add-motif span { font-size: 22px; }
    .motif-caption { padding: 10px; }
    .dialog-card { padding: 28px 21px; }
    .asset-facts { grid-template-columns: 1fr; }
}

/* Warm modern brand theme */
:root {
    --nav: #1b1d22;
    --green: #f26522;
    --lime: #ffe5d3;
    --ink: #25262b;
    --muted: #79756f;
    --line: #e5ded5;
    --bg: #f7f4ef;
}

body { background: #f7f4ef; color: var(--ink); }
.shell aside { background: linear-gradient(180deg, #202229 0%, #17181d 100%); color: #fff; border-right-color: #2d3038; box-shadow: 10px 0 35px rgba(20,20,24,.14); }
.shell aside .brand img { filter: invert(1); }
.club small, .shell aside .kicker { color: #9699a3; }
.shell nav a { color: #b8bbc3; }
.shell nav a.active, .shell nav a:hover { background: #2b2d34; color: #fff; box-shadow: inset 3px 0 0 #ff7433; }
.shell aside form button { color: #aeb1ba; }
.stats article, .panel, .login-card, .motif-tile { border-color: #e6dfd6; box-shadow: 0 12px 34px rgba(60,45,32,.065); }
.stats article:hover, .panel:hover, .motif-tile:hover { border-color: #f0c8ae; }
button.primary, .primary, .actions form button.approve, .floating-menu { background: linear-gradient(135deg, #ff7a38, #e95416); border-color: #eb5d1d; box-shadow: 0 9px 22px rgba(224,78,18,.20); }
.primary:hover, .actions form button.approve:hover { background: linear-gradient(135deg, #f56d2b, #d94910); }
.flash { background: #fff0e5; color: #a94719; border-color: #f4d1ba; }
.status-admin_approved { background: #ffeadc !important; color: #b04a18 !important; }
.login-page { background: radial-gradient(circle at 18% 12%, rgba(255,193,150,.45), transparent 35%), radial-gradient(circle at 86% 84%, rgba(255,224,199,.65), transparent 36%), #faf7f2; }
.login-card { border-color: #e9ded3; }
.login-card input[type=email]:focus, .login-card input[type=password]:focus, .media-field input:focus { border-color: #f58a52; outline-color: rgba(245,112,43,.14); }
.media-icon, .dialog-icon, .dropzone .upload-arrow { background: #ffeadc; color: #d95619; }
.dropzone { border-color: #eab38f; background: #fffaf6; }
.dropzone:hover { background: #fff3ea; border-color: #e77f45; }
.library-head p, .media-title > span { color: #817a73; }
.media-title > span { background: #f1eae2; }
.motif-picture, .asset-detail-preview { background-color: #faf8f4; }
.file-symbol b, .media-actions a { color: #e35b1c; }
.detail-feedback { background: #faf6f1; }
.app-dialog::backdrop { background: rgba(24,20,17,.62); }
.dialog-close:hover { background: #fff3ea; color: #7e3415; }
.media-empty { border-color: #e5c7b3; background: #fcfaf7; }
.media-empty span { color: #ee7135; }
