@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800;900&family=Sora:wght@400;500;600;700;800&display=swap");

:root {
    --gold: #0b8fd0;
    --gold-hover: #0875ad;
    --gold-dark: #075f8f;
    --gold-glow: rgba(11, 143, 208, 0.2);
    --bg: #0a0f1a;
    --bg-2: #0e1625;
    --panel: #0e1625;
    --panel-soft: #132033;
    --text: #f7fbff;
    --muted: #aeb9c8;
    --dim: #6e7d91;
    --line: rgba(255, 255, 255, 0.12);
    --line-gold: rgba(123, 196, 236, 0.34);
    --danger: #ef6b5a;
    --green: #67c98f;
    --amber: #7bc4ec;
    --radius: 12px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
    --font-heading: Sora, Manrope, ui-sans-serif, system-ui, sans-serif;
    --font-body: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #0a0f1a;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 0%, rgba(11, 143, 208, 0.18), transparent 34%),
        radial-gradient(circle at 84% 10%, rgba(123, 196, 236, 0.1), transparent 30%),
        linear-gradient(180deg, #07101f 0%, var(--bg) 48%, #0e1625 100%);
    font-family: var(--font-body);
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px clamp(18px, 4vw, 52px);
    background: rgba(10, 15, 26, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.topbar h1,
.login-card h1,
.section-title h2 {
    margin: 0;
    line-height: 1.05;
    font-family: var(--font-heading);
    font-weight: 500;
}

.topbar h1 {
    font-size: clamp(32px, 4vw, 52px);
    letter-spacing: 0;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-logo,
.login-logo {
    display: block;
    width: 150px;
    max-width: 70vw;
    height: auto;
    margin-bottom: 14px;
}

.login-logo {
    width: 190px;
    margin-bottom: 20px;
}

.layout {
    width: min(1240px, calc(100% - 32px));
    margin: 30px auto 60px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid var(--gold);
    border-radius: 999px;
    color: #f7fbff;
    background: var(--gold);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 22px var(--gold-glow);
}

.button:hover,
button:hover {
    border-color: var(--gold-hover);
    background: var(--gold-hover);
}

.ghost {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 750;
    text-decoration: none;
}

.ghost:hover {
    border-color: var(--line-gold);
    color: var(--gold);
    background: rgba(11, 143, 208, 0.1);
}

.user-pill {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--line-gold);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(11, 143, 208, 0.1);
    font-size: 13px;
    font-weight: 800;
}

.powered {
    color: var(--dim);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.powered-inline {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid rgba(123, 196, 236, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stats article,
.panel,
.project-card,
.empty,
.login-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)), var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stats article {
    padding: 18px;
}

.stats span,
.meta dt,
.next-action span {
    display: block;
    color: var(--dim);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.stats strong {
    display: block;
    margin-top: 6px;
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 500;
}

.filters {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filters a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-weight: 750;
    text-decoration: none;
}

.filters a.active {
    color: #f7fbff;
    border-color: var(--gold);
    background: var(--gold);
}

.filters span {
    opacity: 0.72;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.media-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.recent-media {
    margin: 0 0 20px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)), var(--panel);
    box-shadow: var(--shadow);
}

.recent-media-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.recent-media-list a {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
    text-decoration: none;
}

.recent-media-list strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-media-list span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card {
    display: flex;
    min-height: 380px;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border-top: 4px solid var(--line-gold);
}

.status-en-desarrollo {
    border-top-color: #3ea8e0;
}

.status-esperando-cliente,
.status-pausado {
    border-top-color: var(--amber);
}

.status-entregado,
.status-mantenimiento {
    border-top-color: var(--green);
}

.card-head,
.section-title,
.card-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.card-head h2 {
    margin: 8px 0 4px;
    font-family: var(--font-heading);
    font-size: 29px;
    font-weight: 500;
}

.card-head p,
.muted {
    margin: 0;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border: 1px solid var(--line-gold);
    border-radius: 999px;
    background: rgba(11, 143, 208, 0.1);
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
}

.icon-link {
    color: var(--gold);
    font-weight: 800;
    text-decoration: none;
}

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

.meta div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.035);
}

.meta dd {
    margin: 5px 0 0;
    color: var(--text);
    font-weight: 750;
}

.owner-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.owner-chips span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 7px;
    border: 1px solid var(--line-gold);
    border-radius: 999px;
    color: var(--text);
    background: rgba(11, 143, 208, 0.1);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.next-action {
    padding: 14px;
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    background: rgba(11, 143, 208, 0.1);
}

.next-action p,
.notes {
    margin: 5px 0 0;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--line-gold);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(11, 143, 208, 0.1);
    font-weight: 800;
    text-decoration: none;
}

.todo-list {
    display: grid;
    gap: 8px;
}

.todo {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: start;
    gap: 10px;
}

.todo button {
    width: 22px;
    min-width: 22px;
    min-height: 22px;
    height: 22px;
    margin-top: 1px;
    padding: 0;
    border: 2px solid #6e7d91;
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
}

.todo button.done {
    border-color: var(--green);
    background: var(--green);
}

.done-text {
    color: var(--dim);
    text-decoration: line-through;
}

.notes {
    color: var(--muted);
}

.card-actions {
    align-items: center;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.card-actions small {
    color: var(--dim);
}

.danger {
    min-height: 34px;
    padding: 7px 10px;
    color: var(--danger);
    border-color: rgba(239, 107, 90, 0.35);
    background: rgba(239, 107, 90, 0.08);
    box-shadow: none;
}

.danger:hover {
    color: #f7fbff;
    border-color: var(--danger);
    background: var(--danger);
}

.empty {
    grid-column: 1 / -1;
    padding: 34px;
    text-align: center;
}

.panel {
    padding: 24px;
}

.project-form,
.media-upload {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.media-panel {
    border-color: var(--line-gold);
}

.media-row,
.media-card {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(180px, 0.8fr) minmax(170px, 0.8fr) minmax(220px, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)), var(--panel);
    box-shadow: var(--shadow);
}

.media-row-file,
.media-file-head {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}

.media-file-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--line-gold);
    border-radius: 12px;
    color: #f7fbff;
    background: var(--gold);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 0 18px var(--gold-glow);
}

.media-row-title,
.media-file-head > span {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.media-row-title a,
.media-file-head strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 850;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-row-title span,
.media-file-head small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-row-tags,
.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.media-row-tags span,
.media-tags span {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid var(--line-gold);
    border-radius: 999px;
    color: var(--gold);
    background: rgba(11, 143, 208, 0.1);
    font-size: 12px;
    font-weight: 800;
}

.media-row-details,
.media-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.media-row-details span,
.media-meta div,
.media-meta dd {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-body {
    display: contents;
}

.media-meta {
    grid-template-columns: 1fr;
    margin: 0;
}

.media-meta dt {
    display: none;
}

.media-meta dd {
    margin: 0;
    color: var(--muted);
}

.empty h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 500;
}

.media-url {
    min-width: 0;
    min-height: 34px;
    color: var(--muted);
    font-size: 12px;
}

.media-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.media-card .card-actions {
    margin: 0;
    padding: 0;
    border: 0;
    align-items: center;
}

label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 750;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.owner-picker {
    display: grid;
    gap: 10px;
    color: var(--text);
    font-weight: 750;
}

.owner-picker legend {
    padding: 0;
}

.owner-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.owner-options label {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #07101f;
    color: var(--muted);
    font-weight: 800;
}

.owner-options input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--gold);
}

.owner-options label:has(input:checked) {
    border-color: var(--line-gold);
    color: var(--text);
    background: rgba(11, 143, 208, 0.1);
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: #07101f;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--gold-glow);
    border-color: var(--gold);
}

.wide,
.form-actions {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.alert {
    padding: 12px 14px;
    border: 1px solid rgba(239, 107, 90, 0.35);
    border-radius: var(--radius);
    color: #ffc4bc;
    background: rgba(239, 107, 90, 0.08);
    font-weight: 750;
}

.login-page {
    display: grid;
    min-height: 100vh;
    overflow: hidden;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 42%, rgba(11, 143, 208, 0.13), transparent 30%),
        radial-gradient(circle at 18% 82%, rgba(123, 196, 236, 0.1), transparent 26%),
        radial-gradient(circle at 82% 14%, rgba(11, 143, 208, 0.12), transparent 24%),
        linear-gradient(180deg, #07101f 0%, #0a0f1a 58%, #0e1625 100%);
    isolation: isolate;
    position: relative;
}

.login-page::before,
.login-page::after {
    content: "";
    position: fixed;
    inset: -18%;
    z-index: -1;
    pointer-events: none;
}

.login-page::before {
    opacity: 0.72;
    background:
        radial-gradient(circle, rgba(247, 251, 255, 0.72) 0 1px, transparent 1.6px),
        radial-gradient(circle, rgba(123, 196, 236, 0.48) 0 1.2px, transparent 1.8px),
        radial-gradient(circle, rgba(11, 143, 208, 0.45) 0 1.4px, transparent 2px);
    background-position: 0 0, 38px 24px, 72px 82px;
    background-size: 120px 120px, 190px 190px, 260px 260px;
    filter: drop-shadow(0 0 8px rgba(123, 196, 236, 0.26));
    mask-image: radial-gradient(circle at 50% 48%, black 0%, transparent 76%);
    animation: qc-particles-float 28s linear infinite;
}

.login-page::after {
    opacity: 0.42;
    background:
        linear-gradient(115deg, transparent 0 35%, rgba(123, 196, 236, 0.16) 35.4%, transparent 36.8% 100%),
        linear-gradient(65deg, transparent 0 50%, rgba(11, 143, 208, 0.12) 50.5%, transparent 52% 100%),
        radial-gradient(circle at 22% 28%, rgba(123, 196, 236, 0.18), transparent 18%),
        radial-gradient(circle at 76% 62%, rgba(11, 143, 208, 0.16), transparent 20%);
    background-size: 220% 220%, 180% 180%, 100% 100%, 100% 100%;
    mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 68%);
    animation: qc-light-drift 18s ease-in-out infinite alternate;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(460px, 100%);
    padding: 30px 30px 52px;
    border-color: rgba(123, 196, 236, 0.26);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        rgba(14, 22, 37, 0.86);
    backdrop-filter: blur(18px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), 0 0 45px rgba(11, 143, 208, 0.1);
}

.powered-login {
    position: absolute;
    right: 30px;
    bottom: 22px;
    left: 30px;
    margin: 0;
    color: rgba(174, 185, 200, 0.72);
    text-align: center;
}

.login-card h1 {
    font-size: 44px;
}

.stack {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.hint {
    margin: 18px 0 0;
    color: var(--dim);
    font-size: 13px;
}

code {
    padding: 2px 5px;
    border-radius: 5px;
    color: var(--gold);
    background: rgba(11, 143, 208, 0.1);
}

@keyframes qc-particles-float {
    from {
        transform: translate3d(-18px, 22px, 0) scale(1);
        background-position: 0 0, 38px 24px, 72px 82px;
    }

    to {
        transform: translate3d(18px, -22px, 0) scale(1.03);
        background-position: 120px -120px, -152px 214px, 332px -178px;
    }
}

@keyframes qc-light-drift {
    from {
        transform: translate3d(-4%, 2%, 0) rotate(-1deg);
        background-position: 0% 50%, 100% 0%, 50% 50%, 50% 50%;
    }

    to {
        transform: translate3d(4%, -2%, 0) rotate(1deg);
        background-position: 100% 50%, 0% 100%, 50% 50%, 50% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-page::after {
        animation: none;
    }
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats,
    .project-grid,
    .project-form,
    .media-upload,
    .owner-options,
    .recent-media-list {
        grid-template-columns: 1fr;
    }

    .media-row {
        grid-template-columns: 1fr;
    }

    .media-card {
        grid-template-columns: 1fr;
    }

    .media-actions {
        justify-content: flex-start;
    }

    .meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .layout {
        width: min(100% - 20px, 1220px);
        margin-top: 16px;
    }

    .topbar {
        padding: 18px 14px;
    }

    .topbar nav,
    .topbar nav a {
        width: 100%;
    }

    .topbar nav a,
    .powered-inline {
        justify-content: center;
    }

    .powered-inline {
        width: 100%;
    }

    .project-card,
    .panel,
    .login-card {
        padding: 16px;
    }

    .card-head,
    .section-title,
    .card-actions {
        flex-direction: column;
    }

    .brand-logo,
    .login-logo {
        width: 145px;
    }
}
