/* File: public/assets/css/app.css */

/* Global reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f9f6;
    color: #222;
}

/* Generic hidden helper (used for CAC tabs, method blocks, etc.) */
.hidden {
    display: none !important;
}

a {
    color: #0035a7;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Top bar (used on landing & auth) */
.topbar {
    background: #0035a7;
    color: #fff;
    padding: 12px 0;
}

.topbar .logo {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Footer */
.footer {
    border-top: 1px solid #e2e8e4;
    padding: 15px 0;
    font-size: 0.9rem;
    color: #666;
    background: #ffffff;
}

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.alert-success {
    background: #d1fae5;
    color: #030a88;
    border: 1px solid #193ffd;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Headings */
h1, h2, h3 {
    margin-bottom: 15px;
    color: #0035a7;
}
p {
    margin-bottom: 10px;
}

/* Landing page */
.main-content {
    padding: 30px 0;
}

.landing {
    text-align: center;
    padding: 60px 0;
}

.landing-subtitle {
    max-width: 600px;
    margin: 0 auto 25px auto;
    color: #4b5563;
}

.landing-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.landing-note {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 9px 18px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: #0035a7;
    border-color: #0035a7;
    color: #ffffff;
}
.btn-primary:hover {
    background-color: #0035a7;
    border-color: #0035a7;
}

.btn-outline {
    background-color: transparent;
    border-color: #0035a7;
    color: #0035a7;
}
.btn-outline:hover {
    background-color: #e6f6ec;
}

.btn-block {
    width: 100%;
}

/* Links */
.link-small {
    font-size: 0.9rem;
}

/* AUTH PAGES */
.auth-body {
    background: linear-gradient(135deg, #e6f6ec, #ffffff);
}

.auth-main {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px 22px 28px 22px;
    box-shadow: 0 10px 25px rgba(15, 118, 73, 0.12);
}

.auth-title {
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-form label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #374151;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"],
.auth-form input[type="file"] {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-color: #ffffff;
}

.auth-form input:focus {
    border-color: #0035a7;
    box-shadow: 0 0 0 1px rgba(11, 138, 67, 0.15);
}

.auth-form .form-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.auth-alt {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 15px;
}

.form-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: #991b1b;
}

.form-errors ul {
    margin-left: 18px;
}

/* DASHBOARD LAYOUT */
.dashboard-body {
    background-color: #f5f9f6;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR – fixed on desktop */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0035a7, #01074c);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
}

.sidebar-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon i {
    font-size: 16px;
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 1rem;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0 8px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    padding: 10px 18px 4px 18px;
    letter-spacing: 0.04em;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    border-left: 3px solid transparent;
    border-radius: 4px 0 0 4px;
}

.sidebar-item a i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.sidebar-item a:hover {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.sidebar-item.active a {
    background: #ffffff;
    color: #0035a7;
    border-left-color: #0035a7;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 14px 14px 14px;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.95);
    padding: 6px 6px 6px 10px;
    border-radius: 4px;
}
.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* MAIN DASHBOARD AREA */
.dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 240px; /* leave room for fixed sidebar on desktop */
}

.dashboard-topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.dashboard-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-toggle {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
    color: #4b5563;
}

.dashboard-page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.dashboard-topbar-right {
    display: flex;
    align-items: center;
}

.user-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.82rem;
    color: #4b5563;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #9ca3af;
}

.dashboard-main {
    padding: 18px 18px 24px 18px;
    flex: 1;
    overflow-y: auto;
}

/* Cards & Grid */
.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px 16px 18px 16px;
    box-shadow: 0 6px 15px rgba(15, 118, 73, 0.08);
    margin-bottom: 16px;
}

.card-title {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #0d2b6c;
}

.card-text {
    font-size: 0.92rem;
    color: #4b5563;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.card-balance-amount {
    margin: 6px 0 8px 0;
    font-weight: 700;
    font-size: 1.4rem;
    color: #0035a7;
}

.card-balance-amount .currency {
    font-size: 0.9rem;
    margin-right: 6px;
    color: #3776ff;
}

.card-balance {
    background: linear-gradient(135deg, #ecfdf3, #ffffff);
}

/* Lists */
.quick-actions,
.feature-list {
    list-style: none;
    font-size: 0.9rem;
    color: #374151;
}

.quick-actions li,
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}

.quick-actions li span:first-child {
    color: #3776ff;
}

/* Dashboard footer */
.dashboard-footer {
    padding: 10px 18px 14px 18px;
    font-size: 0.85rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

/* TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table thead {
    background: linear-gradient(90deg, #ecfdf3, #e0f2fe);
}

.table th,
.table td {
    padding: 9px 11px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    font-weight: 600;
    color: #07276b;
    white-space: nowrap;
    font-size: 0.85rem;
}

.table-striped tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.table-hover tbody tr:hover {
    background-color: #f0fdf4;
}

.amount-col {
    text-align: right;
    white-space: nowrap;
}

.amount-text {
    font-weight: 600;
    color: #0035a7;
}

.cell-primary {
    font-size: 0.86rem;
    color: #111827;
}

.cell-secondary {
    font-size: 0.82rem;
    color: #6b7280;
}

.table-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
}

/* Badges & status dots */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    color: #ffffff;
}

.badge-success {
    background-color: #0035a7;
}

.badge-danger {
    background-color: #dc2626;
}

.badge-warning {
    background-color: #f97316;
}

.badge-secondary {
    background-color: #6b7280;
}

.status-cell {
    white-space: nowrap;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 4px;
    vertical-align: middle;
}

.status-successful {
    background-color: #0035a7;
}

.status-pending {
    background-color: #facc15;
}

.status-failed {
    background-color: #dc2626;
}

/* Method pills (NIN & CAC tabs) */
.method-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.method-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    font-size: 0.85rem;
    cursor: pointer;
    color: #374151;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.method-pill input[type="radio"] {
    display: none;
}

.method-pill.active {
    background-color: #ecfdf3;
    border-color: #0035a7;
    color: #0035a7;
    box-shadow: 0 0 0 1px rgba(11, 138, 67, 0.15);
}

/* Slip cards */
.slip-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.slip-card {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    text-align: center;
    cursor: pointer;
    background-color: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.slip-card input[type="radio"] {
    display: none;
}

.slip-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.slip-price {
    font-size: 0.82rem;
    color: #0035a7;
    margin-top: 2px;
}

.slip-card.active {
    border-color: #0035a7;
    background-color: #ecfdf3;
    box-shadow: 0 0 0 1px rgba(11, 138, 67, 0.12);
}

/* NIN / CAC sections */
.nin-section {
    margin-bottom: 16px;
}

.nin-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #111827;
    font-weight: 600;
    margin-bottom: 6px;
}

.nin-section-title .icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ecfdf3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0035a7;
    font-size: 0.75rem;
}

/* NIN/CAC form layout */
.nin-form .form-group {
    margin-bottom: 12px;
}

.nin-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.nin-col {
    min-width: 0;
}

.nin-col input,
.nin-col select {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-color: #ffffff;
}

.nin-col input:focus,
.nin-col select:focus {
    border-color: #0035a7;
    box-shadow: 0 0 0 1px rgba(11, 138, 67, 0.15);
}

.method-block.hidden {
    display: none;
}

.nin-submit-btn {
    margin-top: 6px;
}

/* Director block styling */
.director-block {
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background-color: #f9fafb;
}

/* Consent / modal / raw response */
.consent-group {
    margin-top: 6px;
    margin-bottom: 14px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    color: #374151;
}

.consent-label input[type="checkbox"] {
    margin-top: 3px;
}

.link-button {
    border: none;
    background: none;
    padding: 0;
    margin-left: 4px;
    color: #0035a7;
    cursor: pointer;
    font-size: 0.84rem;
    text-decoration: underline;
}

.link-button:hover {
    color: #0035a7;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 50;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 8px;
    padding: 18px 16px 16px 16px;
    box-shadow: 0 15px 35px rgba(15, 118, 73, 0.25);
    width: 90%;
    max-width: 420px;
    z-index: 60;
}

.modal-content h3 {
    margin-bottom: 8px;
    font-size: 1rem;
    color: #0d317e;
}

.modal-content p {
    font-size: 0.9rem;
    color: #374151;
}

.modal-actions {
    margin-top: 14px;
    text-align: right;
}

body.modal-open {
    overflow: hidden;
}

.raw-response summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: #0035a7;
    margin-top: 8px;
    margin-bottom: 4px;
}

.raw-response pre {
    background: #0f172a;
    color: #e5e7eb;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    max-height: 260px;
    overflow: auto;
}

/* Pagination */
.pagination {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 0.8rem;
    color: #374151;
    background-color: #ffffff;
}

.page-item.active {
    background-color: #0035a7;
    border-color: #0035a7;
    color: #ffffff;
}

.page-item:hover {
    text-decoration: none;
    background-color: #e5f5ec;
}

/* Responsive: overlay sidebar on small screens */
@media (max-width: 900px) {
    .dashboard-layout {
        flex-direction: row;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100vh;
        transform: translateX(0);
        transition: transform 0.2s ease-out;
        z-index: 40;
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    .dashboard-content {
        margin-left: 0; /* content full width under overlay sidebar */
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .dashboard-main {
        padding: 14px 12px 18px 12px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card-table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-table-meta {
        text-align: left;
        margin-top: 6px;
    }

    .slip-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nin-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .landing-actions {
        flex-direction: column;
    }

    .auth-card {
        padding: 20px 16px 22px 16px;
    }
}