/* ========================================
   VerwertungsPartner Portal CSS
   ======================================== */

/* Variables */
:root {
    --color-primary: #1a3d2e;
    --color-secondary: #2d3436;
    --color-background: #f8f7f5;
    --color-white: #ffffff;
    --color-border: #e2e0dc;
    --color-text: #2d3436;
    --color-text-light: #636e72;
    --color-success: #27ae60;
    --color-danger: #e74c3c;
    --font-heading: 'Source Serif 4', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 8px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.user-name {
    font-weight: 500;
    color: var(--color-text);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

/* ========================================
   Navigation Tabs
   ======================================== */
.nav-tabs {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.nav-tabs-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0;
}

.nav-tab {
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: var(--color-text-light);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    color: var(--color-text);
}

.nav-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.badge {
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

/* ========================================
   Main Content
   ======================================== */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Case Card */
.case-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.case-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.case-subtitle {
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

.case-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    background: rgba(39, 174, 96, 0.1);
    color: var(--color-success);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: 50%;
}

.case-details {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.case-detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.case-detail-label {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.case-detail-value {
    font-weight: 500;
    color: var(--color-text);
}

/* ========================================
   Tabs Content
   ======================================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Section Title */
.section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

/* Category Title */
.category-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.category-title:first-of-type {
    margin-top: 0;
}

/* ========================================
   Overview Stats
   ======================================== */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-white);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-value.secondary {
    color: var(--color-text);
}

/* ========================================
   Inventory Table
   ======================================== */
.inventory-table {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 100px 120px 140px;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    background: var(--color-background);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 100px 120px 140px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: var(--color-background);
}

.product-image {
    display: none;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-name {
    font-weight: 600;
    color: var(--color-text);
}

.product-desc {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.product-qty {
    color: var(--color-text);
}

.product-price {
    font-weight: 600;
    color: var(--color-text);
}

.btn-cart {
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cart:hover {
    background: #15332a;
}

.btn-cart.added {
    background: var(--color-success);
}

/* ========================================
   Documents
   ======================================== */
.doc-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--color-white);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.doc-icon {
    width: 40px;
    height: 40px;
    background: var(--color-background);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2;
}

.doc-name {
    font-weight: 500;
    color: var(--color-text);
}

.doc-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    background: var(--color-background);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.doc-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-doc {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-doc-view {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-doc-view:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-doc-download {
    background: var(--color-primary);
    border: none;
    color: white;
}

.btn-doc-download:hover {
    background: #15332a;
}

/* ========================================
   Cart
   ======================================== */
.cart-empty {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    color: var(--color-text-light);
    box-shadow: var(--shadow-sm);
}

.cart-empty p:first-child {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.cart-table {
    background: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.cart-header {
    display: grid;
    grid-template-columns: 1fr 80px 120px 50px 120px;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    background: var(--color-background);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-row {
    display: grid;
    grid-template-columns: 1fr 80px 120px 50px 120px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.cart-row:last-child {
    border-bottom: none;
}

.btn-remove {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-light);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: rgba(231, 76, 60, 0.1);
}

.cart-summary {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 400px;
    margin-left: auto;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--color-text-light);
}

.cart-summary-row.total {
    border-top: 2px solid var(--color-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.cart-summary-row.total .amount {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #15332a;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.pagination-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

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

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    margin-top: 3rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

.footer-brand strong {
    color: var(--color-text);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--color-primary);
}

/* ========================================
   Login Page
   ======================================== */
.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.login-subtitle {
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #15332a;
}

.login-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--color-danger);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.login-error.show {
    display: block;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .header-inner {
        padding: 1rem;
    }

    .user-name {
        display: none;
    }

    .nav-tabs-inner {
        padding: 0 1rem;
        overflow-x: auto;
    }

    .nav-tab {
        padding: 1rem;
        white-space: nowrap;
    }

    .main {
        padding: 1rem;
    }

    .case-header {
        flex-direction: column;
        gap: 1rem;
    }

    .case-details {
        gap: 1.5rem;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr 80px;
        font-size: 0.8125rem;
    }

    .table-header span:nth-child(4),
    .table-header span:nth-child(5),
    .table-row .product-price,
    .table-row .btn-cart {
        display: none;
    }

    .cart-header,
    .cart-row {
        grid-template-columns: 1fr 60px 80px;
    }

    .cart-header span:nth-child(3),
    .cart-header span:nth-child(4),
    .cart-row span:nth-child(3),
    .cart-row .btn-remove {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-white);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-light);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.inq-items {
    background: var(--color-background);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    max-height: 120px;
    overflow-y: auto;
}

.inq-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--color-border);
}

.inq-item:last-child {
    border-bottom: none;
}

.inq-total {
    margin-top: 0.75rem;
    text-align: right;
    font-size: 0.9375rem;
}

.inq-total strong {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}
