:root {
    --pink: #ed4f9a;
    --pink-dark: #d93583;
    --ink: #263238;
    --muted: #6c7480;
    --soft: #f7f3f6;
    --line: #e9e2e7;
    --sidebar: #ffffff;
    --bg: #fbf8fb;
}

/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    text-decoration: none;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.text-pink {
    color: var(--pink) !important;
}

.bg-soft {
    background: var(--soft) !important;
}

.muted {
    color: var(--muted) !important;
}

.text-muted-small {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   Login Page
   ========================================================= */

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 15%, #ffd4e8 0 10%, transparent 20%),
        linear-gradient(135deg, #fa78b2, #f04f9b 48%, #d93684);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Inter, system-ui, Arial, sans-serif;
    position: relative;
    overflow: hidden;
}

.login-body::before,
.login-body::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    background: repeating-radial-gradient(circle, #2b161f 0 7px, transparent 8px 26px);
    opacity: .14;
    transform: rotate(18deg);
    border-radius: 40px;
}

.login-body::before {
    top: -120px;
    left: -90px;
}

.login-body::after {
    bottom: -120px;
    right: -80px;
}

.login-card {
    width: min(430px, 92vw);
    background: #ffffff;
    border-radius: 28px;
    padding: 42px;
    box-shadow: 0 30px 90px rgba(60, 18, 42, .32);
    z-index: 1;
    text-align: center;
}

.login-logo {
    width: 92px;
    height: 92px;
    border-radius: 28px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--pink), #ff91c5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    font-weight: 800;
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 4px;
    color: var(--ink);
}

.login-card p {
    color: var(--muted);
}

/* =========================================================
   Forms & Buttons
   ========================================================= */

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid var(--line);
    padding: 12px 14px;
}

.form-control-sm,
.form-select-sm {
    padding: 6px 8px;
    border-radius: 10px;
}

.form-label {
    font-weight: 700;
    font-size: 13px;
    color: #514d57;
}

.btn-pink {
    background: var(--pink);
    border-color: var(--pink);
    color: #ffffff;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
}

.btn-pink:hover,
.btn-pink:focus {
    background: var(--pink-dark);
    border-color: var(--pink-dark);
    color: #ffffff;
}

.btn-outline-pink {
    border-color: #f3a5cb;
    color: var(--pink-dark);
    border-radius: 12px;
    font-weight: 700;
}

.btn-outline-pink:hover,
.btn-outline-pink:focus {
    background: #fff0f7;
    color: var(--pink-dark);
}

.btn-soft {
    background: #fff0f7;
    color: var(--pink-dark);
    border: 1px solid #ffc3df;
    border-radius: 12px;
    font-weight: 700;
}

.btn-soft:hover {
    background: #ffe4f1;
    color: var(--pink-dark);
}

/* =========================================================
   Layout Helpers
   The main sidebar/topbar layout is controlled by Template.php.
   Do not override .sidebar, .main, .topbar-wrap, or .app-shell here.
   ========================================================= */

.content-inner {
    width: 100%;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.section-gap {
    margin-bottom: 18px;
}

/* =========================================================
   Cards / Panels
   ========================================================= */

.stat-card,
.panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(30, 30, 30, .03);
}

.stat-card .label {
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}

.stat-card .num {
    font-size: 30px;
    font-weight: 800;
    margin-top: 8px;
    color: var(--ink);
}

.stat-card .hint {
    font-size: 12px;
    color: var(--muted);
}

.panel h3,
.panel-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--ink);
    font-weight: 800;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-header h3 {
    margin: 0;
}

.panel-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.mini-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
    background: #ffffff;
}

.info-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #ffffff;
}

.info-card-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--ink);
}

/* =========================================================
   Tables
   ========================================================= */

.table {
    vertical-align: middle;
}

.table th {
    color: #3b424c;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.table td {
    color: #263238;
    font-size: 13px;
}

.table-responsive {
    border-radius: 16px;
}

.table-fixed-actions {
    width: 1%;
    white-space: nowrap;
}

.cell-wrap,
.table .cell-wrap {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.email-cell,
.long-text-cell {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* =========================================================
   Badges / Status
   ========================================================= */

.badge {
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 700;
}

.bg-info {
    background: #e8f5ff !important;
    color: #1263a3 !important;
}

.bg-secondary {
    background: #f0f1f3 !important;
    color: #47505a !important;
}

.bg-primary {
    background: #e9efff !important;
    color: #2854bc !important;
}

.bg-warning {
    background: #fff6e5 !important;
    color: #b26b00 !important;
}

.bg-danger {
    background: #ffe8ef !important;
    color: #be164d !important;
}

.bg-success {
    background: #e7f6ed !important;
    color: #198347 !important;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 750;
}

.status-pill.active,
.status-pill.paid,
.status-pill.approved,
.status-pill.completed {
    background: #e7f6ea;
    color: #198e45;
}

.status-pill.pending,
.status-pill.submitted,
.status-pill.in-progress {
    background: #fff7e8;
    color: #bd7b0a;
}

.status-pill.failed,
.status-pill.rejected,
.status-pill.overdue {
    background: #ffe8ee;
    color: #c9144d;
}

.status-pill.draft,
.status-pill.inactive {
    background: #f0f1f3;
    color: #47505a;
}

.status-pill.sent,
.status-pill.review-needed {
    background: #e9efff;
    color: #2854bc;
}

/* =========================================================
   Tabs
   ========================================================= */

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tabs a {
    padding: 9px 13px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--line);
    text-decoration: none;
    color: #56616f;
    font-weight: 700;
    font-size: 13px;
}

.tabs a.active {
    background: #fff0f7;
    color: var(--pink-dark);
    border-color: #ffc3df;
}

/* =========================================================
   Task / Workflow Rows
   ========================================================= */

.task-row {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 10px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.workflow-row {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
    margin-bottom: 10px;
}

.workflow-row-title {
    font-weight: 800;
    color: var(--ink);
}

.workflow-row-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

/* =========================================================
   Checklist / Progress
   ========================================================= */

.check-pill {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: #ffffff;
    font-weight: 650;
    color: #4e5966;
}

.check-pill input {
    margin-right: 6px;
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: #f3edf1;
}

.progress-bar {
    background: var(--pink);
    border-radius: 999px;
}

/* =========================================================
   Accounting
   ========================================================= */

.accounting-module img,
.accounting-module iframe,
.accounting-module object,
.accounting-module embed,
.accounting-module video {
    max-width: 100%;
    height: auto;
}

.accounting-pl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.accounting-pl-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    background: #ffffff;
    overflow: hidden;
}

.accounting-pl-card h4 {
    font-size: 15px;
    font-weight: 800;
    margin: 0 0 8px;
}

.accounting-pl-value {
    font-size: 22px;
    font-weight: 850;
    color: var(--ink);
}

.accounting-pl-muted {
    color: var(--muted);
    font-size: 12px;
}

/* =========================================================
   Payroll
   Payroll must use the same global Template sidebar/topbar as other modules.
   Do not add .module-payroll sidebar or topbar overrides here.
   ========================================================= */

.payroll-section {
    margin-bottom: 18px;
}

.payroll-grid-standard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.payroll-data-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.payroll-data-row:last-child {
    border-bottom: 0;
}

.payroll-data-label {
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}

.payroll-data-value {
    color: var(--ink);
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

/* =========================================================
   Employees
   ========================================================= */

.employee-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.employee-invoice-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
    margin-bottom: 12px;
}

/* =========================================================
   Documents / Uploads
   ========================================================= */

.upload-box {
    border: 1px dashed #f3a5cb;
    border-radius: 18px;
    background: #fff8fb;
    padding: 18px;
}

.file-name {
    display: inline-block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

/* =========================================================
   Modals
   ========================================================= */

.modal .modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 90px rgba(20, 15, 19, .18);
}

.modal .modal-title {
    font-weight: 850;
}

/* =========================================================
   Utilities
   ========================================================= */

.rounded-xl {
    border-radius: 18px !important;
}

.shadow-soft {
    box-shadow: 0 10px 30px rgba(30, 30, 30, .04) !important;
}

.icon-action {
    border: 0;
    background: transparent;
    color: #201d25;
    font-size: 18px;
}

.link-pink {
    border: 0;
    background: transparent;
    color: var(--pink);
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
}

.link-pink:hover {
    color: var(--pink-dark);
}

.amount {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.masked-value {
    letter-spacing: .08em;
    font-weight: 700;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 18px;
    background: #ffffff;
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    display: block;
    font-size: 34px;
    color: var(--pink);
    margin-bottom: 8px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1280px) {
    .accounting-pl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .employee-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payroll-grid-standard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .task-row {
        flex-direction: column;
    }

    .accounting-pl-grid,
    .employee-summary {
        grid-template-columns: 1fr;
    }

    .page-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 575px) {
    .login-card {
        padding: 30px 22px;
        border-radius: 22px;
    }

    .stat-card,
    .panel {
        padding: 16px;
        border-radius: 18px;
    }

    .stat-card .num {
        font-size: 25px;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tabs {
        gap: 6px;
    }

    .tabs a {
        font-size: 12px;
        padding: 8px 11px;
    }

    .file-name {
        max-width: 180px;
    }
}