/* ==========================================================
   MODERN FINTECH & DASHBOARD THEME
   ========================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Top Navigation Bar --- */
.top {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 16px max(24px, calc((100% - 1180px) / 2));
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    font-weight: 800;
    font-size: 21px;
    letter-spacing: -0.02em;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.top a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.top a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.who {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

/* --- Layout & Container --- */
.wrap {
    max-width: 1180px;
    margin: 28px auto;
    padding: 0 20px;
    min-height: 75vh;
}

.pagehead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin: 0 0 6px;
}

h2 {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 14px;
}

.muted {
    color: #64748b;
    font-size: 14px;
}

/* --- Cards & Panels --- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.card, .panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 6px 16px -2px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-top: 6px;
}

.label {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Forms & Inputs --- */
.formgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

input, select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

input[readonly], select:disabled, input:disabled {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: #059669;
    color: #ffffff;
    padding: 11px 20px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    background: #047857;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: #f1f5f9;
    color: #334155;
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.btn.secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn.danger {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn.danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
    align-items: center;
}

/* --- Tables --- */
.tablewrap {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th, td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    white-space: nowrap;
    font-size: 14px;
}

th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover td {
    background-color: #f8fafc;
}

tr:last-child td {
    border-bottom: 0;
}

.right {
    text-align: right;
}

/* --- Alerts & Notices --- */
.notice {
    padding: 13px 18px;
    border-radius: 12px;
    margin: 14px 0;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-weight: 500;
    font-size: 14px;
}

.notice.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.notice.info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #065f46;
    font-size: 12px;
    font-weight: 700;
}

/* --- Invoice / Entry Header --- */
.invoice {
    max-width: 780px;
    margin: 0 auto;
}

.invoicehead {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 26px 20px;
    text-align: center;
    margin-bottom: 22px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.invoicehead h1 {
    color: #ffffff;
    font-size: 24px;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.invoicehead div {
    color: #93c5fd;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Utilities --- */
.small {
    font-size: 13px;
}

.loginbox {
    max-width: 440px;
    margin: 50px auto;
}

.empty {
    padding: 35px;
    text-align: center;
    color: #64748b;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 28px;
    color: #94a3b8;
    font-size: 13px;
}

.checkline {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.checkline input {
    width: 17px;
    height: 17px;
    cursor: pointer;
}

/* --- Responsive for Mobile Devices --- */
@media (max-width: 650px) {
    .formgrid {
        grid-template-columns: 1fr;
    }
    .field.full {
        grid-column: auto;
    }
    .wrap {
        margin: 16px auto;
        padding: 0 14px;
    }
    .top nav {
        gap: 10px;
    }
    .brand {
        width: 100%;
    }
    h1 {
        font-size: 22px;
    }
}
