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

body, html {
    height: 100%;
    font-family: Tahoma, Arial, sans-serif;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Sidebar CSS */
.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    display: none;
    flex-direction: column;
    border-left: 1px solid #1a252f;
    z-index: 1000;
}

    .sidebar.active {
        display: flex;
    }

    .sidebar h3 {
        font-size: 16px;
        margin-bottom: 20px;
        color: #1abc9c;
    }

    .sidebar ul {
        list-style: none;
    }

        .sidebar ul li a {
            color: #ecf0f1;
            text-decoration: none;
            display: block;
            padding: 12px 0;
            border-bottom: 1px solid #34495e;
            font-size: 14px;
            cursor: pointer;
        }

            .sidebar ul li a:hover {
                color: #1abc9c;
            }

/* Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f4f6f9;
    height: 100%;
    overflow: hidden;
}

.top-header {
    height: 65px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.welcome-banner {
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

    .auth-section input {
        padding: 6px 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 13px;
        width: 130px;
    }

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

    .password-container input {
        padding-left: 32px;
    }

.toggle-password {
    position: absolute;
    left: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: #7f8c8d;
}

#btnLogin {
    background-color: #2980b9;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 32px;
    padding: 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

    #btnLogin:hover {
        background-color: #2471a3;
    }

    #btnLogin .line {
        display: block;
        height: 3px;
        width: 100%;
        background-color: white;
        border-radius: 1px;
    }

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

.btn-accept {
    background-color: #27ae60;
    color: white;
}

    .btn-accept:hover {
        background-color: #219653;
    }

.pdf-viewer-container {
    flex: 1;
    padding: 15px;
    height: calc(100vh - 65px);
}

    .pdf-viewer-container object {
        width: 100%;
        height: 100%;
        border: 1px solid #ccc;
        background: #fff;
        border-radius: 6px;
    }

@media (max-width: 768px) {
    .sidebar.active {
        position: absolute;
        top: 65px;
        right: 0;
        width: 260px;
        height: calc(100vh - 65px);
        box-shadow: -4px 4px 10px rgba(0,0,0,0.2);
        overflow-y: auto;
    }

    .top-header {
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }

    .welcome-banner {
        order: 3;
        width: 100%;
        margin-top: 5px;
    }

    .auth-section input {
        width: 95px;
    }

    .pdf-viewer-container {
        height: calc(100vh - 140px);
    }
}

/* Flex Table Container Layout */
.flex-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
}

.flex-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.flex-header {
    background: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: bold;
    cursor: default;
}

.flex-cell {
    padding: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Specific Column Width Controls */
.col-action {
    flex: 0 0 40px;
    text-align: center;
} /* Expand button (+) */
.col-id {
    flex: 0 0 80px;
}/* رقم البيان */
.col-type {
    flex: 1 1 100px;
}/* نوع البيان */
.col-date {
    flex: 1 1 110px;
}/* تاريخ البيان */
.col-fee {
    flex: 0 0 90px;
}/* قيمة الرسوم */
.col-name {
    flex: 1.5 1 140px;
}/* اسم السائق / المزارع */
.col-vehicle {
    flex: 1 1 100px;
}/* رقم المركبة */
.col-phone {
    flex: 1 1 100px;
}/* الهاتف */
.col-status {
    flex: 0 0 90px;
    text-align: center;
}/* الحالة */

/* Single shared bill viewer: scoped to this page only. */
body.single-bill-page .pdf-viewer-container { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
body.single-bill-page .single-bill-scroll { -webkit-overflow-scrolling:touch; }
body.single-bill-page .single-bill-table { width:100%; min-width:660px; border-collapse:collapse; background:#fff; text-align:right; font-size:13px; }
body.single-bill-page .single-bill-table th { padding:10px; background:#2c3e50; color:#fff; border-bottom:1px solid #ddd; text-align:right; position:sticky; top:0; z-index:1; white-space:nowrap; }
body.single-bill-page .single-bill-table td { vertical-align:top; }
body.single-bill-page .welcome-banner { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
body.single-bill-page .bill-error-panel { padding:14px; margin:10px 0; border:1px solid #e0a2a2; background:#fff7f7; color:#7f1d1d; border-radius:6px; font-size:14px; line-height:1.7; }
body.single-bill-page .bill-retry { display:inline-block; margin-top:10px; background:#2980b9; color:white; border:0; border-radius:5px; padding:9px 18px; cursor:pointer; }
