:root {
    --primary-teal: #0fb4af;
    --primary-green: #1ebc5a;
    --primary-purple: #8e44ad;
    --bg-light: #f4f7f6;
    --text-dark: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --alert-blue: #e3f2fd;
    --alert-text: #0d47a1;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo .e { color: var(--primary-teal); }
.logo .mutabakat { color: var(--primary-green); }

.header-title {
    font-weight: 500;
    color: #444;
    font-size: 1rem;
    flex: 1;
    text-align: center;
}

.lang-select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    background: var(--white);
}

/* Landing Page */
#landing-page {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.landing-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.btn-landing {
    background-color: #1abc9c;
    color: var(--white);
    padding: 1.25rem 2.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-landing:hover {
    background-color: #16a085;
}

/* Dashboard Content */
#dashboard-content {
    display: none;
    flex-direction: column;
    flex: 1;
}

.promo-bar {
    background-color: #f1f1f1;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.promo-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-promo {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 1.5rem auto;
    width: 100%;
    padding: 0 1rem;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary-teal);
}

.card.receiver { border-left-color: var(--primary-green); }

.card-header {
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    font-weight: 600;
}

.card-body { padding: 1.25rem 1rem; }

.summary-card {
    background: var(--white);
    border-radius: 4px;
    border-left: 4px solid var(--primary-purple);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.summary-header {
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-body {
    padding: 1.25rem 1rem;
}

.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 900px;
}

th { background: #f1f1f1; padding: 0.75rem; text-align: left; }
td { padding: 0.75rem; border-bottom: 1px solid var(--border-color); }

.status-badge {
    background: var(--primary-green);
    color: var(--white);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.btn-action {
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
}

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

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

.btn-upload {
    background: #f1f1f1;
    border: 1px dashed #ccc;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    color: var(--primary-green);
    font-weight: 600;
}

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

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .header-container { flex-direction: column; text-align: center; }
    .footer-container { flex-direction: column; gap: 1rem; }

    /* Table to Card Transformation */
    .table-responsive {
        border: none;
        overflow-x: visible; /* Prevent scrollbar container */
    }

    table {
        min-width: 100% !important; /* Force override of 900px */
        width: 100%;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        background: var(--white);
        margin-bottom: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.1);
        padding: 1rem;
        border: 1px solid var(--border-color);
        width: 100%;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 0.75rem 0.5rem 0.75rem 40% !important; /* Adjusted padding */
        text-align: right;
        min-height: 45px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        font-size: 0.9rem;
        word-break: break-all;
    }

    td:last-child {
        border-bottom: 0;
        margin-top: 0.5rem;
    }

    td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        width: 35%;
        padding-right: 10px;
        white-space: normal; /* Allow label to wrap if needed */
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        line-height: 1.2;
    }

    .btn-action {
        width: 100%;
        margin-top: 0.5rem;
        padding: 0.8rem;
        font-size: 0.9rem;
        display: block;
    }

    .status-badge {
        display: inline-block;
    }
}

/* 404 Page Styles */
#error-404 {
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: radial-gradient(circle at center, #ffffff 0%, #f8f9fa 100%);
}

.error-container {
    max-width: 600px;
    animation: fadeIn 0.8s ease-out;
}

.error-icon {
    font-size: 6rem;
    background: linear-gradient(135deg, var(--primary-teal), var(--primary-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

.error-code {
    font-size: 8rem;
    font-weight: 800;
    color: #f1f1f1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    user-select: none;
}

.error-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.error-container p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.btn-back {
    background: linear-gradient(135deg, var(--primary-teal), #16a085);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    border: none;
    cursor: pointer;
}

.btn-back:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(15, 180, 175, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .error-icon { font-size: 4rem; }
    .error-container h1 { font-size: 1.8rem; }
    .error-code { font-size: 5rem; }
}
