/* Legacy custom-container removed - now using .wp-container */

.invoice-box {
    background-color: #1e1e1e;
    padding: 30px 30px 100px 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
    color: #fff;
    position: relative;
    overflow: visible;
    z-index: 1;
}

/* Logo */
.invoice-logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 200px;
}

/* Headings */
.centered-title {
    text-align: center;
    font-size: 26px;
    margin-bottom: 20px;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Ensure proper centering for all rows */
.row.justify-content-center {
    justify-content: center !important;
}

/* Custom Grid (to avoid Bootstrap conflict) */
.custom-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.custom-col {
    flex: 1 1 200px;
}

/* Line Item Header */
.line-item-header {
    display: grid;
    grid-template-columns: 1fr 100px 100px 100px 40px;
    font-weight: bold;
    gap: 10px;
    padding: 10px 0;
}

/* Line Item Rows */
.line-item {
    display: grid;
    grid-template-columns: 1fr 100px 100px 100px 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

/* Prevent currency wrapping and ensure proper alignment */
.text-nowrap {
    white-space: nowrap !important;
}

.line-total {
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 80px;
}

/* Ensure price input groups don't wrap */
.input-group {
    flex-wrap: nowrap;
}

.input-group-text {
    white-space: nowrap;
    min-width: auto;
}

/* Price group styling for unit price inputs */
.price-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 180px;
}

/* Line items layout tweaks */
.qty-input {
  max-width: 80px;
}
.price-group .input-group-text {
  padding-left: 10px; padding-right: 10px;
}
.price-input {
  max-width: 160px; /* long enough to see full value */
}

/* Prevent label wrap like 'Tota l / Acti on' */
.table th, .table td {
  white-space: nowrap;
}

/* ---------- Line item layout fixes ---------- */
.line-items-table th,
.line-items-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.qty-input {
    width: 90px;
    /* wide enough to see 3–4 digits + decimals */
    text-align: right;
}

.price-input {
    width: 160px;
    /* gives room next to the $ prepend */
    text-align: right;
}

.currency-group.input-group {
    display: inline-flex;
    max-width: 230px;
    /* prevents crowding/wrapping */
}

.line-total {
    min-width: 120px;
    font-weight: 700;
}

/* Remove number spinners; we format ourselves */
input.no-spin::-webkit-outer-spin-button,
input.no-spin::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input.no-spin {
    -moz-appearance: textfield;
}

.unit-price-input {
    min-width: 130px;
}

.no-wrap {
    white-space: nowrap;
}

.line-total {
    width: 110px;
    text-align: right;
    white-space: nowrap;
}

/* Improve form layout and centering */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Dashboard specific styles */
.dashboard-container .card {
    margin-bottom: 1.5rem;
}

.dashboard-container .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.dashboard-container .col-xl-3,
.dashboard-container .col-lg-4,
.dashboard-container .col-md-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Ensure cards align evenly */
.dashboard-container .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-container .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Quick Actions section */
.dashboard-container .card-header h6 {
    margin: 0;
}

.dashboard-container .btn-block {
    height: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Recent Invoices table */
.dashboard-container .table-responsive {
    margin: 0;
}

.dashboard-container .table th,
.dashboard-container .table td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* Overdue and Upcoming sections */
.dashboard-container .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 0;
}

.dashboard-container .list-group-item:first-child {
    border-top: none;
}

.dashboard-container .list-group-item:last-child {
    border-bottom: none;
}

/* Invoice Form specific styles */
.invoice-form-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Line item form improvements */
.line-item .form-control {
    border-radius: 0.25rem;
}

.line-item .input-group {
    margin-bottom: 0;
}

.line-item .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Totals section improvements */
.totals-section .form-group {
    margin-bottom: 1rem;
}

.totals-section .input-group {
    margin-bottom: 0;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 15px;
    }

    .dashboard-container .col-xl-3,
    .dashboard-container .col-lg-4,
    .dashboard-container .col-md-6 {
        margin-bottom: 1rem;
    }

    .dashboard-container .btn-block {
        min-height: 45px;
        font-size: 0.9rem;
    }

    .line-item .col-md-1 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .line-item .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .dashboard-container {
        padding: 10px;
    }

    .dashboard-container .card-body {
        padding: 1rem;
    }

    .dashboard-container .table-responsive {
        font-size: 0.875rem;
    }

    .dashboard-container .table th,
    .dashboard-container .table td {
        padding: 0.5rem;
    }

    .line-item .col-md-5 {
        margin-bottom: 0.5rem;
    }

    .line-item .col-md-2 {
        margin-bottom: 0.5rem;
    }

    .line-item .col-md-3 {
        margin-bottom: 0.5rem;
    }
}

/* Ensure proper spacing between sections */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

/* Card shadows and borders */
.card.shadow {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

.card.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.card.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.card.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.card.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.card.border-left-danger {
    border-left: 0.25rem solid #e74a3b !important;
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

.badge-success {
    background-color: #1cc88a !important;
}

.badge-warning {
    background-color: #f6c23e !important;
}

.badge-danger {
    background-color: #e74a3b !important;
}

.badge-info {
    background-color: #36b9cc !important;
}

.badge-secondary {
    background-color: #858796 !important;
}

/* Button improvements */
.btn {
    border-radius: 0.35rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.btn-success {
    background-color: #1cc88a;
    border-color: #1cc88a;
}

.btn-info {
    background-color: #36b9cc;
    border-color: #36b9cc;
}

.btn-warning {
    background-color: #f6c23e;
    border-color: #f6c23e;
}

.btn-danger {
    background-color: #e74a3b;
    border-color: #e74a3b;
}

.btn-secondary {
    background-color: #858796;
    border-color: #858796;
}

/* Form improvements */
.form-control {
    border-radius: 0.35rem;
    border: 1px solid #d1d3e2;
}

.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* Table improvements */
.table {
    border-radius: 0.35rem;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fc;
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
}

/* Ensure proper text alignment */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

/* Flexbox utilities */
.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

/* Spacing utilities */
.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 0.25rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.m-0 {
    margin: 0 !important;
}

.m-1 {
    margin: 0.25rem !important;
}

.m-2 {
    margin: 0.5rem !important;
}

.m-3 {
    margin: 1rem !important;
}

.m-4 {
    margin: 1.5rem !important;
}

/* Ensure proper font weights */
.font-weight-bold {
    font-weight: 700 !important;
}

.font-weight-normal {
    font-weight: 400 !important;
}

.font-weight-light {
    font-weight: 300 !important;
}

/* Global centering */
#page-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Legacy page-container removed - now using .wp-container */

/* Card/grid polish */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

/* Prevent currency wrap anywhere totals appear */
.nowrap {
    white-space: nowrap;
}

/* Fix right-shift caused by accidental overflow */
body,
html {
    overflow-x: hidden;
}

/* Tables: right-align money and prevent wrap */
table td.amount,
table td.total,
.amount,
.total {
    white-space: nowrap;
    text-align: right;
}

/* --- Global centered layout --- */
.wp-container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 16px;
}

/* Auth background */
.wp-auth-bg {
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% 35%, #7b8cff, #6a51ff 45%, #5a3cff 70%);
}

/* Auth wrapper/card */
.wp-auth-wrap {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.wp-auth-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 16px;
}

.wp-badge {
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffb100, #ff8c00);
    color: #fff;
    font-size: 22px;
    display: inline-block;
}

/* Prevent money totals from wrapping anywhere */
.nowrap,
.line-total,
.money,
.amount {
    white-space: nowrap;
}

/* Tables and invoice rows won't squish/wrap totals */
.table td,
.table th {
    vertical-align: middle;
}

/* Kill any legacy narrow sidebar login styles */
.login-sidebar,
.auth-left,
.auth-rail {
    display: none !important;
}

.login-panel,
.auth-form {
    width: 100% !important;
    max-width: none !important;
}

/* Keep inputs clean */
.form-control-lg {
    font-size: 1rem;
}

/* Card polish */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}

/* Fix any rogue container paddings from old templates */
.container,
.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* --- Line items fixes --- */
.no-wrap {
    white-space: nowrap;
}

.line-items-table td,
.line-items-table th {
    vertical-align: middle;
}

.qty-input {
    max-width: 80px;
}

.price-group {
    display: flex;
    align-items: center;
    gap: .25rem;
    min-width: 160px;
}

.price-group .currency-addon {
    flex: 0 0 auto;
}

.price-group input[type="number"],
.price-group input[type="text"] {
    flex: 1 1 auto;
    min-width: 120px;
}

.line-total {
    width: 110px;
    text-align: right;
    white-space: nowrap;
}

.action-cell {
    width: 64px;
}

.line-items .currency-input{display:inline-flex;align-items:center;gap:.5rem;white-space:nowrap}
.line-items .currency-input input{min-width:160px}
.line-items .qty-input{min-width:72px}
.line-items .no-wrap{white-space:nowrap}