/* ---------------------------------------------------------------
   LUNAMA Jewelry Portal – Styles
   Farben: Braun #50341E · Beige #F2EFE9 · Coral #FF6F61
   Fonts:  Playfair Display (Headlines) · Inter (Text)
--------------------------------------------------------------- */

:root {
    --brown: #50341E;
    --brown-soft: rgba(80, 52, 30, 0.65);
    --brown-faint: rgba(80, 52, 30, 0.12);
    --beige: #F2EFE9;
    --coral: #FF6F61;
    --white: #FFFFFF;
    --green: #6D8B5B;
    --radius: 14px;
    --shadow: 0 2px 12px rgba(80, 52, 30, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    background: var(--beige);
    color: var(--brown);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2 { font-family: 'Playfair Display', serif; font-weight: 500; }
h3 { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; margin: 24px 0 8px; color: var(--brown-soft); }

a { color: var(--brown); }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 14px 28px;
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 36px; width: 36px; }
.brand-name { font-family: 'Playfair Display', serif; font-size: 20px; letter-spacing: 0.18em; }
.mainnav { display: flex; gap: 20px; flex: 1; }
.mainnav a {
    text-decoration: none;
    font-weight: 400;
    font-size: 15px;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.mainnav a.active, .mainnav a:hover { border-bottom-color: var(--coral); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.langswitch { display: flex; align-items: center; gap: 8px; }
.lang-label { font-size: 13px; color: var(--brown-soft); }
.lang-group {
    display: inline-flex;
    border: 1px solid var(--brown-faint);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}
.langswitch a {
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    color: var(--brown-soft);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-right: 1px solid var(--brown-faint);
    transition: background 0.15s;
}
.langswitch a:last-child { border-right: none; }
.langswitch a:hover { background: var(--beige); }
.langswitch a.active { background: var(--brown); color: var(--white); }
.lang-flag { font-size: 14px; line-height: 1; }
.logout { font-size: 14px; color: var(--brown-soft); }

/* ---------- Layout ---------- */
.container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 36px 24px 60px; flex: 1; }
.page-title { font-size: 38px; margin-bottom: 6px; }
.page-intro { color: var(--brown-soft); margin-bottom: 28px; max-width: 640px; }
.footer { text-align: center; padding: 20px; font-size: 13px; color: var(--brown-soft); }

/* ---------- Login ---------- */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 80vh; padding: 24px; }
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px 40px;
    text-align: center;
    max-width: 380px;
    width: 100%;
}
.login-logo { height: 64px; margin-bottom: 12px; }
.login-card h1 { font-size: 30px; letter-spacing: 0.2em; }
.login-sub { font-family: 'Playfair Display', serif; font-size: 16px; color: var(--brown-soft); margin-bottom: 18px; }
.login-intro { font-size: 14px; color: var(--brown-soft); margin-bottom: 20px; }
.login-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--brown-faint);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    margin-bottom: 12px;
    background: var(--beige);
    color: var(--brown);
}
.login-card button, .comment-form button {
    background: var(--coral);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.15s;
}
.login-card button:hover, .comment-form button:hover { opacity: 0.88; }
.login-langs { justify-content: center; margin-top: 20px; }

/* ---------- Summary ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 32px; }
.summary-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}
.summary-card.attention { border: 1px solid var(--coral); }
.summary-num { font-family: 'Playfair Display', serif; font-size: 32px; line-height: 1.2; }
.summary-card.attention .summary-num { color: var(--coral); }
.summary-label { font-size: 13px; color: var(--brown-soft); }

/* ---------- Cards Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(80, 52, 30, 0.14); }
.card-img { aspect-ratio: 1 / 1; background: var(--beige); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 18px; }
.card-body h2 { font-size: 19px; margin: 8px 0 2px; }
.card-sku { font-size: 13px; color: var(--brown-soft); margin-bottom: 10px; }
.card-meta { font-size: 13px; color: var(--brown-soft); margin-top: 10px; }
.meta-open { color: var(--coral); font-weight: 500; }
.meta-done { color: var(--green); font-weight: 500; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--brown-faint);
    color: var(--brown);
}
.badge-review     { background: rgba(255, 111, 97, 0.15); color: #D14B3D; }
.badge-open       { background: var(--brown-faint); }
.badge-briefing   { background: rgba(80, 52, 30, 0.18); }
.badge-sample     { background: rgba(214, 168, 80, 0.22); color: #8A6A1F; }
.badge-approved   { background: rgba(109, 139, 91, 0.18); color: var(--green); }
.badge-production { background: rgba(109, 139, 91, 0.18); color: var(--green); }
.badge-done       { background: var(--green); color: var(--white); }

/* ---------- Progress ---------- */
.progress { height: 5px; background: var(--brown-faint); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; background: var(--coral); border-radius: 3px; }

/* ---------- Page-Head mit Ansicht-Umschalter ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.viewswitch { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.viewswitch a { font-size: 13px; padding: 7px 14px; }

/* ---------- Tabellenansicht ---------- */
.tablewrap {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.piecetable { width: 100%; border-collapse: collapse; font-size: 14px; }
.piecetable th {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brown-soft);
    padding: 14px 12px;
    border-bottom: 1px solid var(--brown-faint);
    white-space: nowrap;
}
.piecetable td { padding: 12px; border-bottom: 1px solid var(--brown-faint); vertical-align: middle; }
.piecetable tbody tr { cursor: pointer; transition: background 0.12s; }
.piecetable tbody tr:hover { background: var(--beige); }
.piecetable tbody tr:last-child td { border-bottom: none; }
.td-img img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--beige); display: block; }
.td-name { font-weight: 500; text-decoration: none; display: block; }
.td-sub { font-size: 12px; color: var(--brown-soft); }

/* ---------- Facts (Piece-Detail) ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 4px; }
.fact {
    background: var(--white);
    border: 1px solid var(--brown-faint);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    min-width: 100px;
}
.fact-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brown-soft); }
.fact-value { font-size: 15px; font-weight: 500; }

/* ---------- Detail ---------- */
.backlink { display: inline-block; margin-bottom: 20px; text-decoration: none; font-size: 14px; color: var(--brown-soft); }
.backlink:hover { color: var(--brown); }
.detail { display: grid; grid-template-columns: 360px 1fr; gap: 32px; margin-bottom: 40px; }
.detail-img {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    align-self: start;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-info h1 { font-size: 34px; margin: 8px 0 2px; }
.detail-info .progress { max-width: 420px; margin: 12px 0 4px; }
.notes { white-space: pre-line; }
.muted { color: var(--brown-soft); font-size: 14px; }

/* ---------- Tasks ---------- */
.tasklist { list-style: none; }
.tasklist li { display: flex; gap: 10px; padding: 6px 0; align-items: baseline; }
.tasklist li.done { color: var(--brown-soft); text-decoration: line-through; }
.task-check { font-weight: 600; }
.tasklist li.done .task-check { color: var(--green); text-decoration: none; }
.tasklist li.open .task-check { color: var(--coral); }

/* ---------- Sections / Files ---------- */
.section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    margin-bottom: 24px;
}
.section h2 { font-size: 24px; margin-bottom: 14px; }
.filelist { list-style: none; }
.filelist li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--brown-faint);
    flex-wrap: wrap;
}
.filelist li:last-child { border-bottom: none; }
.filelist a { font-weight: 400; text-decoration: none; border-bottom: 1px solid var(--brown-faint); }
.filelist a:hover { border-bottom-color: var(--coral); }
.file-meta { font-size: 13px; color: var(--brown-soft); }

/* ---------- Comments ---------- */
.comments { margin-bottom: 20px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--brown-faint); }
.comment:last-child { border-bottom: none; }
.comment-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }
.comment-head span { color: var(--brown-soft); }
.comment p { font-size: 15px; }
.comment-form { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin-top: 8px; }
.comment-form input, .comment-form textarea {
    padding: 11px 14px;
    border: 1px solid var(--brown-faint);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    background: var(--beige);
    color: var(--brown);
    resize: vertical;
}
.comment-form button { width: auto; align-self: flex-start; padding: 11px 32px; }

/* ---------- Flash / Error ---------- */
.error { color: #D14B3D; font-size: 14px; margin-bottom: 12px; }
.flash-ok { color: var(--green); font-size: 14px; margin-bottom: 12px; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
    .topbar { gap: 14px; padding: 12px 16px; }
    .mainnav { order: 3; width: 100%; }
    .detail { grid-template-columns: 1fr; }
    .page-title { font-size: 30px; }
    .container { padding: 24px 16px 48px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }

    /* Tabelle wird zu gestapelten Karten – kein seitliches Scrollen nötig */
    .piecetable thead { display: none; }
    .piecetable, .piecetable tbody, .piecetable tr, .piecetable td { display: block; width: 100%; }
    .piecetable tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--brown-faint); }
    .piecetable tbody tr:last-child { border-bottom: none; }
    .piecetable td { border: none; padding: 3px 0; }
    .piecetable td[data-label]:not(.td-img):not(.td-piece) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        font-size: 14px;
    }
    .piecetable td[data-label]:not(.td-img):not(.td-piece)::before {
        content: attr(data-label);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--brown-soft);
    }
    .td-img { float: left; margin-right: 14px; }
    .td-img img { width: 64px; height: 64px; }
    .td-piece { min-height: 64px; display: flex !important; flex-direction: column; justify-content: center; margin-bottom: 8px; }
    .td-piece .td-name { font-size: 16px; }
    .facts { gap: 8px; }
    .fact { flex: 1 1 40%; }
}
