/* ============= Calculate Affiliation Fee - Styles ============= */
* { box-sizing: border-box; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 15px;
    background: #fff;
}

/* For the list page rendered inside an iframe — no outer chrome */
.container-inner {
    background: #fff;
}

.page-title {
    font-size: 22px;
    font-weight: normal;
    margin: 0 0 5px 0;
    color: #333;
}

.title-divider {
    border: none;
    border-top: 2px solid #2c3e50;
    margin: 0 0 10px 0;
}

.required-note {
    text-align: right;
    color: #c0306b;
    font-size: 13px;
    margin: 0 0 10px 0;
}

.req { color: #c0306b; }

/* ============= Panels ============= */
.panel {
    border: 1px solid #ddd;
    margin-bottom: 15px;
    background: #fff;
}

.panel-heading {
    background: #f7f7f7;
    padding: 10px 15px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.panel-body { padding: 10px 15px; }
.panel-body.no-padding { padding: 0; }

.panel-footer {
    padding: 12px 15px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #ddd;
}

/* ============= Form Rows ============= */
.form-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.form-row:last-child { border-bottom: none; }

.form-row label {
    width: 25%;
    font-weight: normal;
    padding-right: 15px;
}

.form-row .form-control {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    height: 34px;
    font-size: 14px;
    background: #fff;
}

.form-row .form-control:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.btn-row {
    justify-content: center;
    border-bottom: none;
}

/* ============= Buttons ============= */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 4px;
    transition: background 0.15s ease;
}

.btn-primary {
    background: #2c3e50;
    color: #fff;
}

.btn-primary:hover { background: #1a252f; }

.btn-view {
    background: #6c757d;
    color: #fff;
}

.btn-view:hover { background: #545b62; }

.btn:disabled,
.btn[disabled] {
    background: #b0b6bb;
    color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.85;
}

/* ============= Tables ============= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table thead th {
    background: #fff;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.data-table tfoot td {
    background: #f0f0f0;
    font-weight: bold;
}

.data-table input[type="text"],
.data-table input[type="number"] {
    width: 100px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.data-table input[type="number"]:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
}

/* Indeterminate "Select All" master state */
.data-table input[type="checkbox"]:indeterminate {
    opacity: 0.7;
}

.total-row td { background: #ececec; }
.text-right  { text-align: right; }
.text-center { text-align: center; }

.muted {
    color: #888;
    padding: 30px 15px;
    font-style: italic;
}

/* ============= Summary Table ============= */
.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.summary-table td.amt {
    width: 200px;
    text-align: left;
    border-left: 1px solid #eee;
    font-weight: bold;
}

.note { font-size: 12px; margin-left: 5px; font-weight: normal; }

/* ============= Iframe wrapper ============= */
iframe#btmAffiliationFeeForm {
    border: none;
    display: block;
    width: 100%;
    min-height: 120px;
}

.login-footer-section{
    padding: 0;
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.required-note{
    color: #c52626;
    font-size: 15px;
    font-weight: 500;
    padding: 0;
    margin: 6px 0;
}

.required-note i{
    color: #2563eb;
    margin-right: 5px;
}

.back-login-btn{
    text-decoration: none;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff !important;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.back-login-btn:hover{
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff !important;
}


/* ==========================================================
   ============ MOBILE VIEW ONLY (max-width: 768px) ===========
   ========================================================== */
@media (max-width: 768px) {

    body { font-size: 13px; }

    .container {
        margin: 0;
        padding: 10px;
    }

    .page-title {
        font-size: 18px;
        text-align: center;
    }

    /* ---- Header row (required note + Back to Login) ---- */
    .login-footer-section {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
    }

    .login-footer-section .required-note {
        text-align: center;
        font-size: 13px;
    }

    .back-login-btn {
        justify-content: center;
        width: 100%;
    }

    /* ---- Form rows: label upar, input neeche ---- */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0;
    }

    .form-row label {
        width: 100%;
        margin-bottom: 5px;
        font-weight: 500;
        padding-right: 0;
    }

    .form-row .form-control {
        width: 100%;
        flex: none;
    }

    /* ---- Buttons: full width, stacked ---- */
    .btn-row {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        margin: 0;
        padding: 10px 16px;
        font-size: 14px;
    }

    .panel-footer {
        padding: 10px;
    }

    .panel-footer .btn {
        display: block;
        width: 100%;
        margin: 6px 0;
    }

    /* ---- Panel heading ko thoda chhota ---- */
    .panel-heading {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* ============================================================
       ===========   TABLE - HORIZONTAL SCROLL ON MOBILE  ==========
       Table ko card nahi banaya, sirf horizontal scroll add kiya.
       User table ko side me swipe karke saare columns dekh sakta hai.
       ============================================================ */
    .panel-body.no-padding {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 720px;       /* columns squash na hon */
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        white-space: nowrap;    /* text wrap na ho, scroll ho */
    }

    .data-table input[type="number"],
    .data-table input[type="text"] {
        width: 80px;
    }

    /* ---- Summary table: label upar, amount neeche right-align ---- */
    .summary-table td {
        display: block;
        width: 100% !important;
        border-left: none !important;
        padding: 8px 12px;
    }

    .summary-table td.amt {
        text-align: right;
        padding-top: 0;
        border-bottom: 1px solid #eee;
    }

    .summary-table tr:last-child td.amt { border-bottom: none; }
}


/* ==========================================================
   =========== SMALL PHONES (max-width: 480px) ================
   ========================================================== */
@media (max-width: 480px) {

    .container { padding: 8px; }

    .page-title { font-size: 16px; }

    .panel-heading {
        padding: 8px 10px;
        font-size: 13px;
    }

    .panel-body { padding: 8px 10px; }

    .data-table { font-size: 11px; }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }

    .btn {
        padding: 9px 12px;
        font-size: 13px;
    }
}