/* ===========================
   FluidPay Payment Terminal
   Main Stylesheet
   =========================== */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #16a34a;
    --error-color: #dc2626;
    --warning-color: #f59e0b;
    --debit-color: #16a34a;
    --credit-color: #2563eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f3f4f6;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===========================
   Navbar
   =========================== */

.navbar {
    background: var(--bg-card);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    font-size: 1.5rem;
}

.brand-text {
    font-weight: 600;
    font-size: 1.125rem;
}

.navbar-menu {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    font-weight: 500;
}

.user-role {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.settings-btn {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.settings-btn:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.logout-btn {
    color: var(--error-color);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Primary Nav Link - Visual Hierarchy */
.nav-link-primary {
    background: var(--primary-color);
    color: white !important;
    font-weight: 500;
}

.nav-link-primary:hover,
.nav-link-primary.active {
    background: var(--primary-hover);
    color: white !important;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
}

.nav-dropdown-toggle .dropdown-arrow {
    transition: transform 0.2s;
}

.nav-dropdown.open .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 200;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.nav-dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}

.nav-dropdown-item:hover {
    background: var(--bg-primary);
}

.nav-dropdown-item.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.08);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: 8px;
    transition: background 0.15s;
    font-family: inherit;
}

.user-dropdown-toggle:hover {
    background: var(--bg-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-dropdown-toggle .dropdown-arrow {
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.user-dropdown.open .user-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 200;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(4px);
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: var(--bg-primary);
}

.user-dropdown-item svg {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.user-dropdown-item.logout-item {
    color: var(--error-color);
}

.user-dropdown-item.logout-item svg {
    color: var(--error-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-primary);
}

.hamburger-icon {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    left: 0;
    transition: transform 0.2s;
}

.hamburger-icon::before {
    top: -6px;
}

.hamburger-icon::after {
    top: 6px;
}

.mobile-menu-toggle.active .hamburger-icon {
    background: transparent;
}

.mobile-menu-toggle.active .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .hamburger-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Mobile user menu items (hidden on desktop) */
.navbar-user-mobile {
    display: none;
}

/* Owner Panel Button */
.owner-panel-btn {
    background: var(--warning-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s;
}

.owner-panel-btn:hover {
    background: #d97706;
}

.owner-panel-link {
    color: var(--warning-color) !important;
}

.logout-link {
    color: var(--error-color) !important;
}

/* Tenant Indicator */
.tenant-indicator {
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Mobile Responsive Navbar */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 2;
    }
    
    .navbar-brand {
        order: 1;
        flex: 1;
        min-width: 0;
    }
    
    .navbar-brand .brand-text {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    
    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
        margin-top: 0.75rem;
        gap: 0.25rem;
    }
    
    .navbar-menu.open {
        display: flex;
    }
    
    .navbar-menu .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
    }
    
    .navbar-menu .nav-link-primary {
        text-align: center;
    }
    
    .navbar-user {
        display: none;
    }
    
    .navbar-user-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        border-top: 1px solid var(--border-color);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .navbar-user-mobile .nav-dropdown-item {
        padding: 0.75rem 1rem;
        border-radius: 8px;
    }
    
    /* Mobile dropdown behavior */
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        padding: 0.75rem 1rem;
        justify-content: space-between;
    }
    
    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: var(--bg-primary);
        border-radius: 8px;
        margin-top: 0.25rem;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }
    
    .nav-dropdown-item {
        padding-left: 2rem;
    }
}

/* ===========================
   Main Content
   =========================== */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ===========================
   Flash Messages
   =========================== */

.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-error {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.flash-success {
    background: #f0fdf4;
    color: var(--success-color);
    border: 1px solid #bbf7d0;
}

.flash-info {
    background: #eff6ff;
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
}

.flash-close:hover {
    opacity: 1;
}

/* ===========================
   Login Page
   =========================== */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-logo-img {
    max-height: 80px;
    max-width: 200px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.tenant-header {
    background: var(--primary-color);
    padding: 1rem;
    text-align: center;
}

.tenant-logo {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--primary-hover);
}

/* ===========================
   Terminal Page
   =========================== */

.terminal-container {
    max-width: 600px;
    margin: 0 auto;
}

.terminal-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.terminal-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-group label .required {
    color: var(--error-color);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

/* Amount Input */
.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.amount-input {
    padding-left: 2.5rem !important;
    font-size: 2rem !important;
    font-weight: 600;
    text-align: right;
}

/* BIN Status */
.bin-status {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: none;
}

.bin-status.loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef3c7;
    color: #92400e;
}

.bin-status.success {
    display: block;
    background: #f0fdf4;
    color: var(--success-color);
}

.bin-status.error {
    display: block;
    background: #fef2f2;
    color: var(--error-color);
}

/* Processor Info */
.processor-info {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.processor-info.hidden {
    display: none;
}

.processor-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-brand {
    font-weight: 600;
}

.card-type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.card-type.debit {
    background: var(--debit-color);
    color: white;
}

.card-type.credit {
    background: var(--credit-color);
    color: white;
}

.fee-info {
    font-weight: 600;
}

/* Fee Summary */
.fee-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #86efac;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.fee-summary.hidden {
    display: none;
}

.fee-summary h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: none;
    letter-spacing: normal;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.summary-row.total {
    border-top: 2px solid #86efac;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
}

/* Collapsible */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-icon {
    transition: transform 0.2s;
}

.collapsible.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible.collapsed .collapsible-content {
    display: none;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: var(--primary-hover);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.privacy-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.privacy-link a {
    color: #6b7280;
    text-decoration: none;
}

.privacy-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ===========================
   Receipt Page
   =========================== */

.receipt-container {
    max-width: 500px;
    margin: 0 auto;
}

.receipt-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.receipt-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.receipt-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
}

.receipt-status.success {
    background: #f0fdf4;
    color: var(--success-color);
}

.status-icon {
    font-size: 1.25rem;
}

.receipt-amount {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.receipt-details {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.receipt-row:last-child {
    border-bottom: none;
}

.receipt-row .label {
    color: var(--text-secondary);
}

.receipt-row .value {
    font-weight: 500;
}

.receipt-row.total-row {
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    background: #f0fdf4;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.receipt-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* ===========================
   History Page
   =========================== */

.history-container {
    max-width: 1000px;
    margin: 0 auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-header h2 {
    font-size: 1.5rem;
}

.filters-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.table-container {
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
    padding: 0.625rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Compact column widths for history table */
.transactions-table th:first-child,
.transactions-table td:first-child {
    /* Date/Time column */
    min-width: 120px;
}

.transactions-table .description-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transactions-table .actions-cell {
    white-space: nowrap;
    min-width: 100px;
}

/* Compact action buttons */
.transactions-table .btn-print-receipt,
.transactions-table .btn-resend-receipt,
.transactions-table .btn-refund,
.transactions-table .btn-void {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    margin-right: 0.125rem;
}

.transactions-table th {
    background: var(--bg-primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.transactions-table .amount {
    font-weight: 600;
}

.card-type-debit {
    color: var(--debit-color);
    font-weight: 500;
}

.card-type-credit {
    color: var(--credit-color);
    font-weight: 500;
}

.status-approved {
    color: var(--success-color);
    font-weight: 500;
}

.status-declined {
    color: var(--error-color);
    font-weight: 500;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem !important;
}

/* Readonly field styling for pre-filled description */
.readonly-field {
    background-color: #f3f4f6;
    color: var(--text-secondary);
    cursor: not-allowed;
}

.field-note {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.page-info {
    color: var(--text-secondary);
}

/* ===========================
   Buttons
   =========================== */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* ===========================
   Email Toggle
   =========================== */

.email-toggle-group {
    margin-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.toggle-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.toggle-text {
    font-size: 1rem;
}

/* ===========================
   Utilities
   =========================== */

.hidden {
    display: none !important;
}

/* ===========================
   Responsive
   =========================== */

/* Tablet breakpoint */
@media (max-width: 768px) {
    /* Navbar */
    .navbar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .navbar-brand {
        width: 100%;
        justify-content: center;
    }
    
    .navbar-menu {
        width: 100%;
        justify-content: center;
    }
    
    .navbar-user {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .user-name, .user-role {
        font-size: 0.875rem;
    }
    
    /* Main Content */
    .main-content {
        padding: 1rem 0.75rem;
    }
    
    /* Terminal */
    .terminal-card {
        padding: 1.5rem;
    }
    
    .terminal-card h2 {
        font-size: 1.25rem;
    }
    
    /* Form rows - stack on tablet */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Amount input */
    .amount-input {
        font-size: 1.5rem !important;
    }
    
    .currency-symbol {
        font-size: 1.25rem;
    }
    
    /* History page */
    .history-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-form {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .filter-group {
        flex: 1;
        min-width: 120px;
    }
    
    .filter-group input {
        width: 100%;
    }
    
    /* Stats row */
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Table - make scrollable with scroll indicator */
    .table-container {
        margin: 0 -0.75rem;
        border-radius: 0;
        position: relative;
    }
    
    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
        pointer-events: none;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Receipt */
    .receipt-card {
        padding: 1.5rem;
    }
    
    .receipt-amount {
        font-size: 2.5rem;
    }
    
    .receipt-actions {
        flex-direction: column;
    }
    
    /* Processor info */
    .processor-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    /* Fee summary */
    .fee-summary {
        padding: 1rem;
    }
    
    /* Login card */
    .login-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .login-logo {
        font-size: 2.5rem;
    }
    
    .login-header h1 {
        font-size: 1.25rem;
    }
}

/* Mobile breakpoint */
@media (max-width: 480px) {
    /* Navbar */
    .navbar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .navbar-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .navbar-user {
        font-size: 0.75rem;
    }
    
    .logout-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Main Content */
    .main-content {
        padding: 0.75rem 0.5rem;
    }
    
    /* Terminal */
    .terminal-container {
        max-width: 100%;
    }
    
    .terminal-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .terminal-card h2 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .form-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    
    .form-section h3 {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.8125rem;
    }
    
    .form-group input {
        padding: 0.625rem;
        font-size: 1rem;
    }
    
    /* Amount input - smaller on mobile */
    .amount-input {
        font-size: 1.25rem !important;
        padding-left: 2rem !important;
    }
    
    .currency-symbol {
        font-size: 1rem;
        left: 0.75rem;
    }
    
    /* Submit button */
    .submit-btn {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    /* History page */
    .history-container {
        max-width: 100%;
    }
    
    .history-header h2 {
        font-size: 1.25rem;
    }
    
    .filters-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filters-form .btn {
        width: 100%;
    }
    
    /* Stats row - stack on small mobile */
    .stats-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .stat-value {
        font-size: 1.125rem;
        order: 2;
    }
    
    .stat-label {
        font-size: 0.875rem;
        order: 1;
    }
    
    /* Table - responsive card layout */
    .transactions-table {
        font-size: 0.8125rem;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 0.5rem 0.375rem;
        white-space: nowrap;
    }
    
    /* Hide less important columns on mobile */
    .transactions-table th:nth-child(5),
    .transactions-table td:nth-child(5) {
        display: none;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Receipt */
    .receipt-container {
        max-width: 100%;
    }
    
    .receipt-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .receipt-header {
        margin-bottom: 1rem;
    }
    
    .receipt-status {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .receipt-amount {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .receipt-row {
        padding: 0.5rem 0;
        font-size: 0.875rem;
    }
    
    .receipt-row .label {
        font-size: 0.8125rem;
    }
    
    /* Login */
    .login-container {
        min-height: 70vh;
        padding: 1rem 0;
    }
    
    .login-card {
        padding: 1.25rem;
        margin: 0 0.5rem;
        border-radius: 8px;
    }
    
    .login-logo {
        font-size: 2rem;
    }
    
    .login-header h1 {
        font-size: 1.125rem;
    }
    
    .login-header p {
        font-size: 0.875rem;
    }
    
    .login-btn {
        padding: 0.75rem;
        font-size: 0.9375rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
    }
    
    /* Flash messages */
    .flash-message {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Processor info */
    .processor-info {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .card-type {
        font-size: 0.6875rem;
    }
    
    /* Fee summary */
    .fee-summary {
        padding: 0.75rem;
    }
    
    .fee-summary h3 {
        font-size: 0.875rem;
    }
    
    .summary-row {
        font-size: 0.875rem;
        padding: 0.375rem 0;
    }
    
    .summary-row.total {
        font-size: 1rem;
    }
    
    /* Customer signin card */
    .customer-signin-card {
        max-width: 100%;
    }
    
    .bypass-2fa-section {
        margin-top: 1rem;
        padding-top: 0.75rem;
    }
    
    .bypass-notice {
        font-size: 0.75rem;
    }
    
    .bypass-btn {
        padding: 0.625rem 1rem;
        font-size: 0.75rem;
    }
    
    /* Verification page */
    .verification-code-input {
        font-size: 1.5rem !important;
        letter-spacing: 0.3em;
    }
    
    .verification-info {
        font-size: 0.8125rem;
    }
}

/* ===========================
   Customer Sign-In Page
   =========================== */

.customer-signin-card {
    max-width: 450px;
}

.phone-input {
    font-size: 1.125rem;
    letter-spacing: 0.05em;
}

.form-help {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.admin-link {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.admin-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.admin-link a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Verification Page */
.verification-code-input {
    font-size: 2rem !important;
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: 600;
}

.verification-info {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.verification-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.verification-info a:hover {
    text-decoration: underline;
}

.code-expiry {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--warning-color);
}

/* Bypass 2FA Section */
.bypass-2fa-section {
    margin-top: 1.5rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.bypass-notice {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.bypass-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--warning-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.bypass-btn:hover {
    background: #d97706;
}

/* ===========================
   Owner Panel / Tenant Switcher
   =========================== */

.tenant-indicator {
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.owner-panel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    margin-right: 12px;
}

.owner-panel-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ===========================
   Dark Mode Support
   =========================== */

[data-theme="dark"] body {
    background-color: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .navbar {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .main-content {
    background-color: #0f172a;
}

[data-theme="dark"] .terminal-card,
[data-theme="dark"] .receipt-card,
[data-theme="dark"] .login-card {
    background: #1e293b;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .form-group input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .form-section {
    border-color: #334155;
}

[data-theme="dark"] .table-container {
    background: #1e293b;
}

[data-theme="dark"] .transactions-table th {
    background: #0f172a;
    color: #94a3b8;
}

[data-theme="dark"] .transactions-table td {
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .stat-card {
    background: #1e293b;
}

[data-theme="dark"] .help-text {
    color: #94a3b8;
}

[data-theme="dark"] .api-config-note {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* ===========================
   Progressive Disclosure
   =========================== */

.collapsible-section {
    margin-bottom: 24px;
}

.collapsible-section .collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.collapsible-section .collapsible-header:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.collapsible-section .collapsible-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 0;
}

.collapsible-header .section-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.collapsible-header .section-badge.optional {
    background: #e2e8f0;
    color: #64748b;
}

.collapsible-header .section-badge.required {
    background: #fef2f2;
    color: #dc2626;
}

.collapse-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    padding: 0 20px;
}

.collapsible-section:not(.collapsed) .collapsible-content {
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: white;
}

.collapsible-section.collapsed .collapsible-header {
    border-radius: 8px;
}

.collapsible-section:not(.collapsed) .collapsible-header {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

/* Show Advanced Toggle Button */
.show-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.show-advanced-toggle:hover {
    border-color: #1e293b;
    color: #1e293b;
    background: #f8fafc;
}

.show-advanced-toggle.active {
    border-style: solid;
    border-color: #1e293b;
    color: #1e293b;
    background: #f8fafc;
}

/* Advanced Section */
.advanced-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed #e2e8f0;
}

.advanced-section.hidden {
    display: none;
}

.advanced-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advanced-section-header::before,
.advanced-section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Tooltip for field hints */
.field-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 10px;
    color: #64748b;
    cursor: help;
}

.field-hint:hover::after {
    content: attr(data-hint);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1e293b;
    color: white;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    border-radius: 6px;
    margin-bottom: 8px;
    z-index: 100;
}

.field-hint:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    margin-bottom: -4px;
    z-index: 100;
}

/* ===========================
   Confirmation Dialog
   =========================== */

.confirmation-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.confirmation-dialog-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 440px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.confirmation-dialog-overlay.show .confirmation-dialog {
    transform: scale(1);
}

[data-theme="dark"] .confirmation-dialog {
    background: #1e293b;
}

.confirmation-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
}

.confirmation-dialog-icon {
    flex-shrink: 0;
}

.confirmation-dialog-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

[data-theme="dark"] .confirmation-dialog-title {
    color: #f1f5f9;
}

.confirmation-dialog-body {
    padding: 16px 24px;
}

.confirmation-dialog-message {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

[data-theme="dark"] .confirmation-dialog-message {
    color: #94a3b8;
}

.confirmation-dialog-details {
    margin-top: 12px;
}

.confirmation-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e2e8f0;
}

[data-theme="dark"] .confirmation-dialog-footer {
    border-top-color: #334155;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

/* ===========================
   Site Footer
   =========================== */

.site-footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.site-footer .footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.site-footer .footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
