* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --sidebar: #111827;
    --sidebar-hover: #1f2937;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --shadow: 0 8px 30px rgba(15, 23, 42, .06);
}

html,
body {
    min-height: 100%;
}

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

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}


/* layout */

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 245px;
    background:
        linear-gradient(
            180deg,
            #111827 0%,
            #0f172a 100%
        );
    color: white;
    padding: 24px 16px;
    z-index: 20;
    display: flex;
    flex-direction: column;
}

.main {
    margin-left: 245px;
    min-height: 100vh;
}

.topbar {
    height: 82px;
    display: flex;
    align-items: center;
    padding: 0 34px;
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page {
    padding: 30px 34px 60px;
}


/* brand */

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px;
    margin-bottom: 32px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            #6366f1,
            #8b5cf6
        );
    box-shadow:
        0 8px 20px rgba(99,102,241,.3);
    font-size: 20px;
    font-weight: 800;
}

.brand-text strong {
    display: block;
    font-size: 15px;
}

.brand-text span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-top: 3px;
}


/* menu */

.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #cbd5e1;
    padding: 11px 12px;
    border-radius: 9px;
    transition: .15s;
}

.menu a:hover {
    background: var(--sidebar-hover);
    color: white;
}

.menu a.active {
    background: rgba(99,102,241,.18);
    color: white;
}

.menu-icon {
    width: 20px;
    text-align: center;
    opacity: .9;
}


/* sidebar footer */

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 17px 8px 0;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #334155;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-block strong {
    display: block;
    font-size: 13px;
}

.user-block span {
    font-size: 11px;
    color: #94a3b8;
}

.logout-button {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 3px 0;
}

.logout-button:hover {
    color: white;
}


/* topbar */

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .11em;
    font-size: 10px;
    font-weight: 700;
    color: #818cf8;
    margin-bottom: 4px;
}

.topbar-heading {
    margin: 0;
    font-size: 20px;
    line-height: 1;
}


/* page heading */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-head h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.02em;
}

.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
}


/* search */

.search-panel {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--surface);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0 14px 0 36px;
    outline: none;
    background: #fff;
}

.search-box input:focus {
    border-color: #a5b4fc;
    box-shadow:
        0 0 0 3px rgba(99,102,241,.1);
}

.search-panel select {
    height: 42px;
    min-width: 160px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    padding: 0 12px;
}


/* buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 15px;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 650;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: white;
    color: #475569;
    border-color: var(--border);
}


/* catalog */

.catalog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.catalog-header {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
}

.catalog-count {
    color: var(--muted);
    font-size: 12px;
}

.catalog-table-wrap {
    overflow-x: auto;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
}

.catalog-table thead {
    background: #f8fafc;
}

.catalog-table th {
    text-align: left;
    padding: 11px 14px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.catalog-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.catalog-table tbody tr {
    transition: .12s;
}

.catalog-table tbody tr:hover {
    background: #fafbff;
}

.catalog-table tbody tr:last-child td {
    border-bottom: 0;
}

.cover-col {
    width: 70px;
}

.track-col {
    width: 80px;
}

.catalog-cover {
    width: 50px;
    height: 50px;
    display: block;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: white;
}

.catalog-cover-empty {
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 8px;
    font-weight: 800;
    background: #f1f5f9;
}

.artist {
    font-weight: 600;
    color: #334155;
}

.release-cell {
    min-width: 330px;
    max-width: 620px;
}

.release-title {
    text-decoration: none;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.35;
}

.release-title:hover {
    color: var(--primary);
}

.release-meta {
    color: #94a3b8;
    font-size: 11px;
    margin-top: 5px;
}

.price {
    font-weight: 750;
    white-space: nowrap;
}

.mono {
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 12px;
}

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


/* badges */

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-stock {
    background: #dcfce7;
    color: #166534;
}

.badge-preorder {
    background: #fef3c7;
    color: #92400e;
}

.badge-sold {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #e2e8f0;
    color: #475569;
}

.track-pill {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 27px;
    padding: 0 7px;
    border-radius: 7px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 750;
    font-size: 12px;
}

.track-pill.empty {
    background: #f1f5f9;
    color: #94a3b8;
}


/* detail */

.back-link {
    display: inline-block;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 18px;
}

.back-link:hover {
    color: var(--primary);
}

.product-card {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.product-cover-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.detail-cover {
    width: 100%;
    max-width: 285px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.detail-cover-empty {
    display: grid;
    place-items: center;
    color: #94a3b8;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 800;
}

.product-content {
    padding-top: 4px;
}

.product-topline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
}

.product-code {
    color: #64748b;
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 12px;
}

.product-title {
    margin: 0;
    max-width: 900px;
    font-size: 28px;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.product-artist {
    margin-top: 10px;
    color: #64748b;
    font-size: 17px;
    font-weight: 550;
}

.product-price {
    font-size: 28px;
    font-weight: 800;
    margin-top: 22px;
}

.info-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(150px, 1fr));
    gap: 10px;
    margin: 24px 0;
}

.info-item {
    background: var(--surface-soft);
    border: 1px solid #edf1f5;
    border-radius: 10px;
    padding: 13px;
}

.info-item span {
    display: block;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}

.info-item strong {
    font-size: 13px;
}

.product-actions {
    margin-top: 6px;
}


/* tracks */

.track-card {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-heading {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.section-heading h3 {
    margin: 0;
    font-size: 18px;
}

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.track-list {
    padding: 5px 0;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.track-row:last-child {
    border-bottom: 0;
}

.track-number {
    width: 34px;
    color: #94a3b8;
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 12px;
}

.track-main strong {
    display: block;
    font-size: 14px;
}

.track-main span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-top: 4px;
}

.no-tracks {
    text-align: center;
    padding: 55px 20px;
    color: #64748b;
}

.no-tracks-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 13px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 20px;
}

.no-tracks strong {
    display: block;
    color: #334155;
    margin-bottom: 5px;
}

.no-tracks span {
    font-size: 12px;
}


/* errors */

.error-card {
    margin-top: 20px;
    padding: 18px;
    border-radius: 12px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.error-card pre {
    white-space: pre-wrap;
    word-break: break-word;
}


/* empty */

.empty-state {
    padding: 55px 20px;
    text-align: center;
}

.empty-state strong {
    display: block;
    margin-bottom: 5px;
}

.empty-state span {
    color: var(--muted);
}


/* responsive */

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

    .product-card {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 850px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        margin-left: 0;
    }

    .menu {
        flex-direction: row;
    }

    .topbar {
        position: static;
    }

    .page {
        padding: 20px;
    }

    .search-panel {
        flex-wrap: wrap;
    }

    .search-box {
        flex-basis: 100%;
    }

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

    .detail-cover {
        max-width: 340px;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 0 20px;
    }

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

    .product-card {
        padding: 18px;
    }

    .product-title {
        font-size: 23px;
    }
}


/* Dashboard */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.dashboard-stat {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 18px 18px 21px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dashboard-stat-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-stat-value {
    margin-top: 9px;
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.03em;
}

.dashboard-stat-line {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
}

.stat-purple {
    background: #6366f1;
}

.stat-green {
    background: #22c55e;
}

.stat-yellow {
    background: #f59e0b;
}

.stat-red {
    background: #ef4444;
}

.stat-blue {
    background: #3b82f6;
}

.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.dashboard-panel-header {
    min-height: 72px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.dashboard-panel-header h3 {
    margin: 0;
    font-size: 16px;
}

.dashboard-panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.dashboard-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 650;
    font-size: 12px;
}

.dashboard-link:hover {
    color: var(--primary-hover);
}

@media (max-width: 1400px) {
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dashboard-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}

.dashboard-stat-link:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(15, 23, 42, .10);
    border-color: #c7d2fe;
}

.dashboard-stat-link:active {
    transform: translateY(0);
}

/* Login page */

.login-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(99,102,241,.22), transparent 35%),
        radial-gradient(circle at 80% 80%, rgba(139,92,246,.16), transparent 35%),
        #0f172a;
}

.login-card {
    width: 100%;
    max-width: 390px;
    background: #ffffff;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.32);
}

.login-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(99,102,241,.3);
    margin-bottom: 22px;
}

.login-card h1 {
    margin: 0;
    font-size: 27px;
    letter-spacing: -.03em;
}

.login-card > p {
    margin: 7px 0 27px;
    color: #64748b;
    font-size: 13px;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #dbe1ea;
    border-radius: 9px;
    background: #fff;
    color: #111827;
    outline: none;
    transition: .15s;
}

.form-group input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.login-error {
    padding: 10px 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 12px;
}


/* Login */

.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(99,102,241,.22), transparent 32%),
        radial-gradient(circle at 85% 85%, rgba(139,92,246,.18), transparent 35%),
        #0f172a;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 36px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.login-logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 21px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(99,102,241,.30);
}

.login-card h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -.03em;
    color: #111827;
}

.login-card > p {
    margin: 7px 0 28px;
    color: #64748b;
    font-size: 13px;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #dbe1ea;
    border-radius: 9px;
    background: #fff;
    color: #111827;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.login-submit {
    width: 100%;
    margin-top: 5px;
}

.login-error {
    margin-bottom: 15px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 12px;
}


.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 22px;
    border-top: 1px solid #e5e7eb;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #dfe3ea;
    border-radius: 9px;
    background: #fff;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
}

.pagination a:hover {
    border-color: #5b4df5;
    color: #5b4df5;
}

.pagination-current {
    padding: 0 10px;
    font-size: 14px;
    color: #64748b;
}

.search-panel select {
    min-height: 42px;
}

.shipping-panel {
    margin: 22px 0;
    padding: 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}

.shipping-panel-header {
    margin-bottom: 16px;
}

.shipping-panel-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.shipping-panel-header p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.shipping-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.shipping-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 16px;
    min-height: 84px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f8fafc;
    text-decoration: none;
    transition: 0.15s ease;
}

.shipping-stat:hover {
    border-color: #5b4df5;
    background: #fff;
    transform: translateY(-1px);
}

.shipping-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.shipping-stat strong {
    font-size: 24px;
    line-height: 1.1;
    color: #0f172a;
}

.shipping-stat small {
    font-size: 11px;
    color: #94a3b8;
}

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

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

@media (max-width: 520px) {
    .shipping-grid {
        grid-template-columns: 1fr;
    }
}
