main > .container {
    padding: 70px 15px 20px;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display:block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

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

/* Consistent Bootstrap 5 form sizing across the entire application */
.form-control,
.form-select,
.input-group-text {
    font-size: 0.875rem;
    padding: 0.375rem 0.6rem;
    line-height: 1.4;
    border-radius: 6px;
}
textarea.form-control { line-height: 1.45; }
.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #344054;
    margin-bottom: 0.25rem;
}
.form-text, .help-block {
    font-size: 0.75rem;
    color: #6c757d;
}
.invalid-feedback {
    font-size: 0.75rem;
}
/* Buttons inside forms align with the new input height */
.btn {
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
}
.btn-sm { font-size: 0.78rem; padding: 0.25rem 0.55rem; }
.btn-lg { font-size: 1rem; padding: 0.55rem 1.1rem; }

body {
    background-color: #f5f6f8;
}

.main-content {
    background-color: #f5f6f8;
}

/* Page Header in Main Layout */
.page-header-modern {
    background: white;
    border-radius: 12px;
}

.page-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-icon i {
    font-size: 24px;
    color: white;
}

.page-header-modern h1 {
    font-size: 22px;
    font-weight: 600;
    color: #212529;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 13px;
    color: #6c757d;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 2px;
}

.page-header-modern .breadcrumb {
    background: transparent;
    padding: 0;
}

.page-header-modern .breadcrumb-item {
    color: #6c757d;
    font-size: 13px;
}

.page-header-modern .breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

.page-header-modern .breadcrumb-item.active {
    color: #495057;
}

.page-header-modern .breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
}

.page-header-modern .breadcrumb-item a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Modern Grid and Page Styles */
.modern-index { font-size: 14px; }
.page-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 2rem; border-radius: 10px; margin-bottom: 1.5rem; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.page-header h1 { margin: 0; font-size: 2rem; font-weight: 600; }
.page-header .subtitle { opacity: 0.9; margin-top: 0.5rem; }
.grid-container { background: transparent; border-radius: 0; padding: 0; box-shadow: none; }
.grid-container .table { font-size: 0.85rem; margin-bottom: 0; }
.grid-container .table tbody td { padding: 8px; vertical-align: middle; }
.grid-container .table tbody tr { transition: background 0.15s; }
.grid-container .table tbody tr:hover { background: #f8f9fa; }

/* Apply professional grid header styling to ALL Yii2 GridViews app-wide */
.grid-view {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.grid-view > .table-responsive { margin: 0; }
.grid-view .table {
    font-size: 0.85rem;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: auto;
}

/* Column width balance: keep numeric / status / id / action columns compact
   so wide text columns get the leftover space and don't wrap to 2 lines. */
.grid-view .table th.text-end,
.grid-view .table td.text-end,
.grid-view .table th[data-col="numeric"],
.grid-view .table td[data-col="numeric"] {
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Yii2 SerialColumn (#), id, status, dates, amounts: keep narrow + nowrap */
.grid-view .table th:first-child,
.grid-view .table td:first-child { width: 1%; white-space: nowrap; }

/* ActionColumn is last — keep it tight */
.grid-view .table th:last-child,
.grid-view .table td:last-child { width: 1%; white-space: nowrap; text-align: center; }

/* Common attribute-name based shrinking — Yii2 GridView adds no class to <td>
   but column header cells get no specific class either; rely on data-attribute
   conventions if present, plus generic helpers below. */
.grid-view .table .nowrap,
.grid-view .table td.nowrap,
.grid-view .table th.nowrap { white-space: nowrap; }
.grid-view .table .shrink { width: 1%; white-space: nowrap; }

/* Make horizontal scroll graceful instead of wrapping cells when many cols */
.grid-view {
    overflow-x: auto;
}
.grid-view .table thead th,
.grid-view .table > thead > tr > th {
    background: #f4f6fa;
    font-weight: 600;
    color: #344054;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-top: 0;
    border-bottom: 1px solid #e4e7ec;
    vertical-align: middle;
    padding: 5px 8px;
    white-space: nowrap;
    line-height: 1.2;
}
.grid-view .table thead tr.filters th,
.grid-view .table > thead > tr.filters > th {
    background: #fafbfc;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    padding: 3px 6px;
    border-bottom: 1px solid #e4e7ec;
}
.grid-view .table thead th a {
    color: #344054;
    text-decoration: none;
}
.grid-view .table thead th a:hover { color: #4f46e5; }
.grid-view .table tbody td {
    padding: 4px 8px;
    vertical-align: middle;
    border-top: 1px solid #f0f2f5;
    color: #475467;
    line-height: 1.3;
}
.grid-view .table tbody tr:first-child td { border-top: 0; }
.grid-view .table tbody tr:hover { background: #f9fafb; }
.grid-view .table tbody tr.empty td {
    text-align: center;
    color: #98a2b3;
    padding: 24px;
    font-style: italic;
}

/* Filter inputs inside grid header */
.grid-view .table thead .form-control,
.grid-view .table thead .form-select {
    padding: 4px 8px;
    font-size: 0.8rem;
    height: auto;
    min-height: 30px;
    border-radius: 4px;
}

/* Footer row: summary + pagination */
/* Export toolbar (Excel + PDF + summary) injected by grid-export.js */
.grid-view > .grid-export-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    background: #fff;
    border-bottom: 1px solid #e4e7ec;
}
.grid-view > .grid-export-toolbar .grid-export-summary {
    color: #667085;
    font-size: 0.78rem;
}
.grid-view > .grid-export-toolbar .grid-export-summary .summary {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}
.grid-view > .grid-export-toolbar .grid-export-buttons {
    display: flex;
    gap: 6px;
}
.grid-view > .grid-export-toolbar .grid-export-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    line-height: 1.3;
}

/* Print: only the temporary print holder (with all rows) is visible */
#grid-print-holder { display: none; }
@media print {
    body.grid-printing * { visibility: hidden !important; }
    body.grid-printing #grid-print-holder,
    body.grid-printing #grid-print-holder * { visibility: visible !important; }
    body.grid-printing #grid-print-holder {
        display: block !important;
        position: absolute !important;
        top: 0; left: 0; right: 0;
    }
    body.grid-printing #grid-print-holder .grid-view {
        border: 0 !important;
        box-shadow: none !important;
    }
    body.grid-printing #grid-print-holder .table thead th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

.grid-view > .summary {
    padding: 6px 10px;
    color: #667085;
    font-size: 0.75rem;
    background: #fafbfc;
    border-top: 1px solid #e4e7ec;
}
.grid-view > .pagination,
.grid-view nav > .pagination {
    margin: 0;
    padding: 6px 10px;
    background: #fafbfc;
    border-top: 1px solid #e4e7ec;
    justify-content: flex-end;
}
.grid-view .action-btn,
.grid-view .btn-sm {
    padding: 2px 6px;
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Compact Grid Inputs */
.grid-container .form-control, .grid-container .form-select { 
    padding: 4px 8px; 
    font-size: 0.85rem; 
    height: auto;
    min-height: 32px;
}

/* Action Column Buttons */
.action-btn { 
    padding: 4px 8px; 
    margin: 0 2px; 
    font-size: 0.8rem; 
    line-height: 1.2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn i {
    font-size: 0.85rem;
}
.stock-badge { padding: 0.4rem 0.8rem; border-radius: 20px; font-weight: 600; font-size: 0.85rem; }
.stock-high { background: #d4edda; color: #155724; }
.stock-medium { background: #fff3cd; color: #856404; }
.stock-low { background: #f8d7da; color: #721c24; }
.action-btn { padding: 0.25rem 0.5rem; margin: 0 0.1rem; font-size: 0.85rem; }
.modal-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.modal-header .btn-close { filter: brightness(0) invert(1); }
/* Pagination - professional look matching grid styling */
.pagination,
.grid-container .pagination {
    display: inline-flex;
    flex-wrap: wrap;
    padding-left: 0;
    list-style: none;
    margin: 0;
    gap: 0;
}
.grid-view .summary {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0;
}
.grid-view .dataTables_wrapper,
.grid-view + .pagination,
.grid-container > .pagination {
    margin-top: 1rem;
}
.pagination .page-item .page-link,
.grid-container .page-link {
    position: relative;
    display: block;
    padding: 0.4rem 0.75rem;
    color: #667eea;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: all 0.15s ease-in-out;
}
.pagination .page-item:not(:first-child) .page-link,
.grid-container .page-item:not(:first-child) .page-link {
    margin-left: -1px;
}
.pagination .page-item:first-child .page-link {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}
.pagination .page-item:last-child .page-link {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}
.pagination .page-item .page-link:hover {
    background-color: #f1f3ff;
    color: #764ba2;
    border-color: #dee2e6;
    z-index: 2;
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.25);
}
.pagination .page-item.disabled .page-link {
    color: #adb5bd;
    background-color: #fff;
    border-color: #dee2e6;
    pointer-events: none;
    cursor: not-allowed;
}
.pagination .page-item .page-link:focus {
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(102, 126, 234, 0.25);
    z-index: 3;
}

/* Wrap GridView footer (summary + pager) into a clean row */
.grid-view {
    margin-bottom: 0;
}
.grid-view > .summary,
.grid-container > .summary {
    padding: 0.5rem 0;
}
.grid-view > .pagination,
.grid-container > .pagination {
    padding: 0.5rem 0;
}

/* Transaction Custom Invoice Styles */
.transaction-row {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
    transition: all 0.3s ease;
}

.transaction-row:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.transaction-rows-container {
    margin: 20px 0;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.customer-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.customer-card {
    background: white;
    padding: 20px;
    border-radius: 7px;
}

.btn-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-gradient-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    border: none;
    color: white;
}

.btn-gradient-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-gradient-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border: none;
    color: white;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.total-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2px;
    border-radius: 8px;
    margin-top: 20px;
}

.total-card {
    background: white;
    padding: 15px 20px;
    border-radius: 7px;
    text-align: right;
}

.total-amount {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}
