/* ============================================================
   CRYPTID GLOBAL THEME — CLEAN, CENTERED, DARK BUTTONS
   ============================================================ */

:root {
    --cryptid-dark: #112637;
    --cryptid-dark-alt: #0d1a29;
    --cryptid-blue: #1e3a8a;
    --cryptid-blue-hover: #172f6a;
    --cryptid-light: #f1f1f1;
    --cryptid-card-bg: #ffffff;
    --cryptid-border: #0d1a29;
    --cryptid-gray: #ccc;
    --cryptid-danger: #c62828;
    --cryptid-danger-hover: #8b1f1f;
}

/* ============================================================
   BASE LAYOUT
   ============================================================ */

body {
    font-family: Arial, sans-serif;
    background: var(--cryptid-dark);
    color: var(--cryptid-light);
    margin: 0;
    padding: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--cryptid-light);
}

/* ============================================================
   CARDS / SECTIONS
   ============================================================ */

.section,
.card,
.login-box {
    background: var(--cryptid-card-bg);
    color: var(--cryptid-dark);
    padding: 18px;
    border-radius: 8px;
    border: 1px solid var(--cryptid-border);
    margin-top: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.section h3,
.card h3 {
    color: var(--cryptid-dark);
}

/* ============================================================
   INPUTS
   ============================================================ */

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    margin: 6px 0 14px 0;
    box-sizing: border-box;
    background: var(--cryptid-light);
    color: var(--cryptid-dark);
    border: 1px solid var(--cryptid-gray);
    border-radius: 4px;
}

/* ============================================================
   BUTTONS — BLUE DEFAULT
   ============================================================ */

button,
.action,
.pay-btn,
.convert-btn {
    padding: 10px 16px;
    cursor: pointer;
    margin-right: 6px;
    background: var(--cryptid-blue);
    color: #ffffff;
    border: 1px solid var(--cryptid-blue-hover);
    border-radius: 4px;
}

button:hover,
.action:hover {
    background: var(--cryptid-blue-hover);
}

/* Secondary buttons */
.convert-btn {
    background: #e0e0e0;
    color: var(--cryptid-dark);
    border: 1px solid #999;
}

.convert-btn:hover {
    background: #d5d5d5;
}

/* ============================================================
   TABLES
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--cryptid-card-bg);
    margin-top: 12px;
    table-layout: auto;
}

th,
td {
    border: 1px solid var(--cryptid-gray);
    padding: 8px 10px;
    color: var(--cryptid-dark);
}

th {
    background: #eee;
    text-align: left;
}

/* Keep action buttons on one line */
td:last-child {
    white-space: nowrap;
    width: 150px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.card-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

/* ⭐ Dashboard cards ONLY — NOT global cards */
.card-row .card {
    width: 300px;
    padding: 20px;
}

.stat {
    font-size: 1.2em;
    margin: 8px 0;
    color: var(--cryptid-dark);
}

/* ============================================================
   TOP BAR
   ============================================================ */

.top-bar {
    margin-bottom: 15px;
}

.top-bar button {
    background: var(--cryptid-blue);
    border: 1px solid var(--cryptid-blue-hover);
    color: #ffffff;
}

.top-bar button:hover {
    background: var(--cryptid-blue-hover);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

body.login-page {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    background: var(--cryptid-dark) !important;
}

.login-box {
    text-align: center;
}

body.login-page .login-box * {
    color: var(--cryptid-dark) !important;
}

body.login-page .login-box button {
    color: #ffffff !important;
}

/* ============================================================
   TOTALS
   ============================================================ */

.total-box {
    font-size: 1.2em;
    margin-top: 10px;
    font-weight: bold;
    color: var(--cryptid-dark);
}

/* ============================================================
   COMPLIANCE
   ============================================================ */

.btn-upload {
    background: #2e7d32;
    color: white;
}

.btn-edit {
    background: #0277bd;
    color: white;
}

.doc-row {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--cryptid-card-bg);
    border: 1px solid #ddd;
    border-radius: 6px;
    color: var(--cryptid-dark);
}

/* ============================================================
   ACTIVITY LOG
   ============================================================ */

tr:nth-child(even) {
    background: #fafafa;
}

/* ============================================================
   PDF STYLES
   ============================================================ */

.pdf-body {
    font-family: sans-serif;
    margin: 30px;
    color: #222;
}

.header-box {
    border: 2px solid #444;
    padding: 15px;
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.1em;
    margin-top: 25px;
    margin-bottom: 8px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

.right {
    text-align: right;
}

.footer {
    margin-top: 40px;
    font-size: 0.8em;
    text-align: center;
    color: #666;
}

/* ============================================================
   INVOICE TABLE
   ============================================================ */

#invoiceTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#invoiceTable th,
#invoiceTable td {
    padding: 8px 10px;
    border: 1px solid #ccc;
    text-align: left;
    font-size: 14px;
}

#invoiceTable th {
    background: #f2f2f2;
    font-weight: bold;
    white-space: normal;
}

#invoiceTable td:last-child {
    white-space: nowrap;
}

#invoiceTable td:last-child .action {
    margin-right: 4px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.nav .logout {
    margin-left: auto;
    width: auto;
    flex: 0 0 auto;
}

.nav button {
    padding: 4px 8px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
}

.nav-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.dashboard-page h1 {
    text-align: center;
}

/* ============================================================
   FIX: BUTTON COLOR IN TABLES
   ============================================================ */

table button {
    color: #ffffff !important;
}

/* ============================================================
   OPTIONAL CENTERING UTILITY
   ============================================================ */

.page-center {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}
