:root {
    --primary-color: #ff6b35;
    --secondary-color: #4B5563;
    --background-color: #f5f5f5;
    --surface-color: #FFFFFF;
    --text-color: #333333;
    --border-color: #E5E7EB;
    --success-color: #28a745;
    --error-color: #dc3545;
    --input-focus: #ff6b35;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

/* Make element sizing predictable */
*, *::before, *::after { box-sizing: border-box; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-row {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin: 0 auto;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Boxed page wrapper to match design: orange rounded border with inner white surface */
.boxed {
    max-width: 1200px;
    margin: 1.5rem auto;
    border-radius: 12px;
    padding: 10px; /* space for the outer border look */
    background-clip: padding-box;
    position: relative;
    box-shadow: 0 2px 0 rgba(0,0,0,0.04) inset;
    border: 1px solid var(--primary-color);
}

.boxed-inner {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    /* subtle orange inner line */
    box-shadow: inset 0 0 0 3px rgba(255,107,53,0.04);
}

/* small rounded tab in the top-left of the outer box */
.box-tab {
    position: absolute;
    left: 22px;
    top: -12px;
    background: #fff;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid var(--primary-color);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    font-size: 0.9rem;
}

/* Login Section */
.login-section {
    background: transparent;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    box-shadow: none;
    margin-bottom: 1rem;
    border: none;
}

.login-section h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.login-inner {
    background: #fff;
    padding: 1.25rem 1.25rem;
    border-radius: 6px;
    border: 1px solid var(--primary-color);
}

.login-inner .form-group { margin-bottom: 0.75rem; }
.login-inner input { background: #f7fbff; border: 1px solid rgba(0,0,0,0.06); }
.login-inner .login-btn { display: block; margin: 1rem auto 0; width: 85%; }
.login-inner input { width: 100%; }
.login-inner .create-area { text-align: right; margin-top: 0.75rem; }
/* Make inputs consistent height and padding so alignment matches */
.login-inner input,
.create-inner input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"] {
    height: 44px;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.95rem;
    border-radius: 6px;
}
/* Ensure inputs vertical alignment */
.login-inner input, .create-inner input { line-height: 1.2; }

/* Provide extra right padding for password fields to make room for toggle */
.password-group input { padding-right: 44px; }

/* Make login/create buttons full width and consistent */
.login-inner .login-btn,
.create-inner .login-btn {
    width: 100%;
    padding: 0.6rem 1rem;
}

.create-inner { display: block; background: #fff; padding: 1.25rem 1.5rem; border-radius: 8px; border: 1px solid var(--primary-color); }
.create-inner { padding: 1.25rem 1.25rem; border-radius: 6px; }
.create-inner.hidden { display: none; }
.create-inner .form-group { margin-bottom: 0.75rem; }
.create-inner input { background: #f7fbff; border: 1px solid rgba(0,0,0,0.06); width: 100%; }


/* Info Section */
.info-text {
    margin: 1.5rem 0;
    color: var(--secondary-color);
    line-height: 1.6;
}

.info-text p {
    margin-bottom: 0.5rem;
}

/* Small helper note text that should follow the site's color vars (theme-aware) */
.help-note {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    position: relative;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--input-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

/* Icon sizing inside toggle button */
.toggle-password svg { display: block; width: 20px; height: 20px; }
.toggle-password:focus { outline: 2px solid rgba(255,107,53,0.2); border-radius: 4px; }
.toggle-password[aria-pressed="true"] { color: var(--primary-color); }

/* Buttons */
.btn,
.login-btn,
.export-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.btn:hover,
.login-btn:hover,
.export-btn:hover {
    background-color: #e85a2c;
    transform: translateY(-1px);
}

.btn:active,
.login-btn:active,
.export-btn:active {
    transform: translateY(0);
}

.login-btn {
    width: 100%;
    margin-bottom: 1rem;
}

.export-btn {
    white-space: nowrap;
    padding: 0.75rem 2rem;
}

.create-account-link { display: inline-block; margin-top: 0.5rem; color: var(--primary-color); font-weight:600; }

/* Messages */
.message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.success-message { background-color: #D1FAE5; color: #065F46; }
.error-message { background-color: #FEE2E2; color: #991B1B; }


/* User Dashboard */
header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
header h1 { font-size: 1.5rem; margin: 0; }
header nav { display: flex; align-items: center; gap: 1rem; }

.dashboard-section {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
}
.section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.section-header h2 { margin: 0; font-size: 1.25rem; }
.section-content { padding: 1.5rem; }
.toggle-icon { font-size: 1.2rem; transition: transform 0.2s; }

/* Transaction Table */
.table-container {
    overflow-x: auto;
    background: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.6rem; /* tighten space between filters and table */
    font-size: 0.9375rem;
}

.transaction-table th,
.transaction-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.transaction-table th {
    background-color: #fff;
    font-weight: 600;
    color: var(--text-color);
    border-top: 1px solid var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

.transaction-table th:first-child {
    border-left: 1px solid var(--primary-color);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.transaction-table th:last-child {
    border-right: 1px solid var(--primary-color);
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.transaction-table tr:hover {
    background-color: #f8f9fa;
}
.payment-log-section h2 { font-size: 1.5rem; margin-top: 0; margin-bottom: 0.5rem; }

.invoice-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    text-decoration: none;
    background-color: #EFF6FF;
    color: #2563EB;
    border-radius: 999px;
    font-size: 0.8125rem;
    transition: background-color 0.2s;
}

.invoice-link:hover {
    background-color: #DBEAFE;
}

/* Filter Section */
.filter-section {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Transaction Log tab styling similar to mock */
.filter-section {
    position: relative;
    background: transparent;
    /* add top padding so the pseudo tab doesn't overlap the filters */
    padding: 1.1rem 0 0.5rem 0;
    display: flex;
    flex-direction: column;
}


.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0; /* remove bottom space as requested */
    padding-top: 0.6rem; /* add top space so the Transaction Log pill clears the inputs */
}

.filters { align-items: center; }

.filter-section .export-btn { margin-left: auto; }

.transaction-full { margin-top: 1rem; }

.filter-input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.9375rem;
}

.top-row > .login-section { max-width: 380px; align-self: start; }
.top-row > .payment-log-section { align-self: start; }

.filter-input:focus {
    border-color: var(--input-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }

    .filter-input,
    .export-btn {
        width: 100%;
    }
    .top-row {
        grid-template-columns: 1fr;
    }
    .login-section, .payment-log-section { padding: 1rem; }
}

/* Loader */
.loader { text-align: center; padding: 1.5rem; font-weight: 500; color: var(--secondary-color); }
.hidden { display: none; }

/* Responsive */
@media (max-width: 600px) {
    .auth-box { padding: 1.5rem; }
    .filters { flex-direction: column; }
    header .container { justify-content: center; text-align: center; }
}