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

:root {
    --primary: #2d7a3e;
    --primary-dark: #1f5c2e;
    --secondary: #f4f4f4;
    --accent: #ff6b35;
    --text: #333;
    --border: #ddd;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;

    /* Mobile breakpoints */
    --mobile: 480px;
    --tablet: 768px;
    --desktop: 1024px;
}

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

.hidden {
    display: none !important;
}

/* Navigation */
.navbar {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.nav-links button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.nav-links button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hamburger menu (hidden on desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Pages */
.page {
    display: none;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page.active {
    display: block;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: transform 0.3s;
}

.cta-button:hover {
    transform: translateY(-2px);
}

/* Services Grid */
.services {
    margin-bottom: 3rem;
}

.services h2, .packages h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.3s;
}

.service-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.service-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.service-card .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
    margin: 1rem 0;
}

/* Package Cards */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.package-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s;
}

.package-card.featured {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.package-card:hover {
    transform: translateY(-4px);
}

.package-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.package-card .price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
}

.package-card .duration {
    color: #666;
    margin-bottom: 1rem;
}

.package-card ul {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
}

.package-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.package-card ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
}

.btn:hover {
    background: #e0e0e0;
}

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

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.quote-form-section {
    max-width: 600px;
    margin: 0 auto;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.billing-settings-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.billing-settings-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* ===== MOBILE RESPONSIVE UTILITIES ===== */

/* Horizontal scroll wrapper for tables */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Scroll shadow indicator */
.table-scroll-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.table-scroll-wrapper.has-scroll::after {
    opacity: 1;
}

/* SQL Query Editor Layout */
.sql-query-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

/* DB Explorer Sidebar */
.sql-query-layout > div:first-child {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    max-height: 700px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sql-query-layout > div:first-child h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Query Section */
.query-section {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Query Cookbook */
.query-cookbook {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.query-cookbook h3 {
    font-size: 1em;
    margin-bottom: 12px;
    color: #495057;
    font-weight: 600;
}

/* SQL Textarea */
#sql-query-input {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    width: 100%;
    padding: 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    background: #f8f9fa;
    color: #212529;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s, background-color 0.2s;
}

#sql-query-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.1);
}

#sql-query-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Query Controls */
.query-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.query-controls-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.query-controls-divider {
    width: 1px;
    height: 32px;
    background: #dee2e6;
    margin: 0 8px;
}

#save-query-name {
    padding: 0.6rem 0.8rem;
    border: 2px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 200px;
    transition: border-color 0.2s;
}

#save-query-name:focus {
    outline: none;
    border-color: var(--primary);
}

/* Query Results Container */
#query-results {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    min-height: 60px;
}

#query-results:empty {
    display: none;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 2rem;
    border-radius: 4px;
    text-align: center;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Mobile admin tabs dropdown (hidden on desktop) */
.admin-tabs-mobile {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 2rem;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    background: white;
    cursor: pointer;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

table th {
    background: var(--primary);
    color: white;
    padding: 1rem;
    text-align: left;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

table tr:hover {
    background: var(--secondary);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-scheduled {
    background: #cce5ff;
    color: #004085;
}

.status-new {
    background: #fff3cd;
    color: #856404;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.invoice-modal-content {
    max-width: 800px;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: var(--text);
}

/* Invoice View */
.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.invoice-items {
    margin: 2rem 0;
}

.invoice-items table {
    margin-bottom: 1rem;
}

.invoice-total {
    text-align: right;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.overdue-banner {
    background: #dc3545;
    color: white;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
}

.previous-balance-section {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-size: 1.1rem;
}

.previous-balance-row {
    background: #fff3cd !important;
    font-weight: 600;
}

.overdue-row {
    background: #ffebee;
}

.overdue-row:hover {
    background: #ffcdd2 !important;
}

.payment-options {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.payment-btn {
    flex: 1;
    min-width: 150px;
}

.invoice-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.invoice-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hamburger Navigation */
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 250px;
        height: calc(100vh - 60px);
        background: var(--primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 0;
        gap: 0;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        z-index: 1000;
        margin-top: 0;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links a,
    .nav-links button {
        width: 100%;
        padding: 1rem 2rem;
        text-align: left;
        border-radius: 0;
        margin: 0;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    /* Hide desktop tabs, show mobile dropdown */
    .admin-tabs {
        display: none;
    }

    .admin-tabs-mobile {
        display: block;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }

    .tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .payment-options {
        flex-direction: column;
    }

    .payment-btn {
        width: 100%;
    }

    /* Responsive tables */
    table {
        font-size: 0.85rem;
        min-width: 800px; /* Force horizontal scroll */
    }

    table th, table td {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    /* Sticky first column for context */
    table th:first-child,
    table td:first-child {
        position: sticky;
        left: 0;
        background: inherit;
        z-index: 10;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }

    table th:first-child {
        background: var(--primary);
    }

    table tbody tr:nth-child(even) td:first-child {
        background: #f9f9f9;
    }

    table tbody tr:nth-child(odd) td:first-child {
        background: white;
    }

    /* SQL Query Editor - Stack vertically */
    .sql-query-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sql-query-layout > div:first-child {
        max-height: 300px;
        overflow-y: auto;
    }

    /* Query controls stack on mobile */
    .query-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .query-controls-group {
        width: 100%;
        flex-direction: column;
    }

    .query-controls-group button {
        width: 100%;
    }

    .query-controls-divider {
        display: none;
    }

    #save-query-name {
        width: 100%;
        min-width: unset;
    }

    /* Touch-friendly tap targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 1rem;
    }

    /* Larger tap targets in tables */
    table button,
    table a {
        min-width: 44px;
        min-height: 36px;
    }

    /* Responsive modals */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 95vh;
        overflow-y: auto;
    }

    /* Tab header stacking */
    .tab-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tab-header button {
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    /* Very small screens */
    .page {
        padding: 0.75rem;
    }

    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .package-card.featured {
        transform: scale(1);
    }

    /* Compact stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    /* Compact invoice form */
    .modal-content.invoice-modal {
        padding: 12px;
    }

    .invoice-items-table {
        font-size: 12px;
    }

    .service-presets {
        gap: 8px;
    }

    .service-preset-btn {
        min-width: 100px;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Login Page */
.login-section {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
}

/* Small button for logout */
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-small:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== ORACLE'S INVOICE FORM REDESIGN ===== */

/* Invoice Form - Table Layout */
.invoice-items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.invoice-items-table thead {
  background: #f0f7f2;
}

.invoice-items-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #2d2d2d;
  border-bottom: 2px solid #e0e0e0;
  font-size: 14px;
}

.invoice-items-table th.col-qty,
.invoice-items-table th.col-price,
.invoice-items-table th.col-total {
  text-align: right;
}

.invoice-items-table tbody tr {
  background: white;
}

.invoice-items-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.invoice-items-table tbody tr:hover {
  background: #f5f5f5;
}

.invoice-items-table td {
  padding: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.invoice-items-table tbody tr:last-child td {
  border-bottom: none;
}

.invoice-items-table input {
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
}

.invoice-items-table input:focus {
  background: white;
  border: 2px solid var(--primary);
  outline: none;
  border-radius: 4px;
}

.invoice-items-table input[type="number"] {
  text-align: right;
}

.invoice-items-table .line-total {
  text-align: right;
  color: #666;
  font-weight: 500;
  padding-right: 16px;
  font-size: 14px;
  white-space: nowrap;
}

.invoice-items-table .col-description {
  width: 50%;
}

.invoice-items-table .col-qty {
  width: 80px;
}

.invoice-items-table .col-price {
  width: 100px;
}

.invoice-items-table .col-total {
  width: 100px;
}

.invoice-items-table .col-actions {
  width: 50px;
  text-align: center;
}

/* Remove button */
.btn-remove {
  background: white;
  border: 1px solid #e0e0e0;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  color: #999;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-remove:disabled {
  opacity: 0;
  pointer-events: none;
}

/* Service Preset Buttons */
.service-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 24px;
}

.service-presets-label {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 8px;
  display: block;
}

.service-preset-btn {
  background: white;
  border: 2px solid #e0e0e0;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  text-align: center;
}

.service-preset-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.service-preset-btn .service-name {
  font-size: 14px;
  font-weight: 600;
  color: #2d2d2d;
  margin-bottom: 4px;
}

.service-preset-btn .service-price {
  font-size: 12px;
  color: #666;
}

.service-preset-custom {
  border-style: dashed;
}

.service-preset-custom .service-name {
  color: var(--primary);
}

/* Add Line Item Button */
.btn-add-item {
  background: white;
  border: 2px dashed #e0e0e0;
  color: var(--primary);
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  margin: 16px 0;
}

.btn-add-item:hover {
  border-color: var(--primary);
  background: #f0f7f2;
}

/* Invoice Subtotal */
.invoice-subtotal {
  text-align: right;
  margin: 24px 0 16px;
  padding: 16px 0;
  border-top: 2px solid #e0e0e0;
}

.invoice-subtotal .label {
  color: #666;
  font-size: 18px;
  font-weight: normal;
  margin-right: 16px;
}

.invoice-subtotal .amount {
  color: var(--primary);
  font-size: 28px;
  font-weight: bold;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #e0e0e0;
}

.btn-cancel {
  background: white;
  border: 1px solid #e0e0e0;
  color: #666;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  font-family: inherit;
}

.btn-cancel:hover {
  background: #f5f5f5;
}

.btn-create-invoice {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

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

.btn-create-invoice:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Section dividers */
.form-divider {
  border: 0;
  border-top: 1px solid #e0e0e0;
  margin: 24px 0;
}

/* Invoice Form Modal - Wider */
#modal .modal-content.invoice-modal {
  max-width: 850px;
}

/* Form section headers */
.form-section-header {
  font-size: 16px;
  font-weight: 600;
  color: #2d2d2d;
  margin-bottom: 16px;
}

/* Tablet Responsive */
@media (max-width: 768px) {
  #modal .modal-content.invoice-modal {
    max-width: 95vw;
    padding: 16px;
  }

  .service-presets {
    flex-direction: column;
  }

  .service-preset-btn {
    width: 100%;
  }

  .invoice-subtotal .label {
    font-size: 16px;
  }

  .invoice-subtotal .amount {
    font-size: 24px;
  }

  /* Invoice form - responsive columns */
  .invoice-items-table {
    font-size: 13px;
  }

  .invoice-items-table th,
  .invoice-items-table td {
    padding: 6px;
  }

  .invoice-items-table .col-description {
    width: 40%;
  }

  .invoice-items-table .col-qty {
    width: 60px;
  }

  .invoice-items-table .col-price {
    width: 80px;
  }

  .invoice-items-table .col-total {
    width: 80px;
  }

  .invoice-items-table .col-actions {
    width: 40px;
  }

  .invoice-items-table input {
    padding: 6px;
    font-size: 13px;
  }

  .btn-remove {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }
}

/* Invoice Export Actions */
.invoice-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selection-actions .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 500;
}

.selection-actions .checkbox-label input[type="checkbox"] {
    margin: 0;
}

.invoice-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Customer Portal Export */
.customer-invoice-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 1.1rem;
}

/* Error state */
.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Invoice card improvements */
.invoice-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.invoice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.invoice-card-body {
    margin-bottom: 1rem;
}

.invoice-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.invoice-detail:last-child {
    border-bottom: none;
}

.invoice-detail .label {
    font-weight: 500;
    color: #6c757d;
}

.invoice-detail .value {
    text-align: right;
}

.invoice-detail .value.amount {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2d7a3e;
}

.invoice-card-footer {
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.invoice-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

.invoices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .invoices-grid {
        grid-template-columns: 1fr;
    }

    .invoice-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .selection-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== CUSTOMER PORTAL HEADER ===== */
.customer-portal-header {
    background: linear-gradient(135deg, #2d7a3e 0%, #1f5c2e 100%);
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.customer-portal-brand {
    margin-bottom: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 32px;
}

.brand-name {
    font-size: 24px;
    font-weight: bold;
}

.customer-greeting {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

#customer-name-display {
    font-weight: 600;
}

.customer-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.customer-email {
    font-size: 14px;
    opacity: 0.9;
}

.btn-customer-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-customer-logout:hover {
    background: rgba(255,255,255,0.25);
}

.logout-icon {
    font-size: 18px;
}

@media (max-width: 768px) {
    .customer-portal-header {
        padding: 1.5rem;
    }

    .customer-header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-customer-logout {
        width: 100%;
        justify-content: center;
    }
}

/* ===== CUSTOMER AUTH PAGE ===== */
.customer-auth-container {
    max-width: 450px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

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

.auth-logo {
    font-size: 64px;
    margin-bottom: 1rem;
}

.customer-auth-header h1 {
    font-size: 32px;
    color: #2d2d2d;
    margin: 0 0 0.5rem 0;
}

.auth-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Tabs */
.customer-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    background: #f5f5f5;
    padding: 6px;
    border-radius: 10px;
}

.customer-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.customer-auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Auth Content */
.customer-auth-content {
    display: none;
}

.customer-auth-content.active {
    display: block;
}

.customer-auth-form {
    margin-bottom: 1.5rem;
}

/* Form Groups */
.form-group-customer {
    margin-bottom: 1.5rem;
}

.form-group-customer label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 8px;
}

.form-group-customer input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group-customer input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.1);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* Primary Button - Customer */
.btn-customer-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-customer-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 122, 62, 0.3);
}

.btn-customer-primary:active {
    transform: translateY(0);
}

/* Auth Note */
.auth-note {
    background: #f0f7f2;
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* Footer Text */
.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin: 0;
}

.auth-footer-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* Back to Home Link */
.auth-back-to-home {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.auth-back-to-home a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.auth-back-to-home a:hover {
    color: var(--primary);
}

/* Mobile */
@media (max-width: 480px) {
    .customer-auth-container {
        margin: 2rem 1rem;
        padding: 2rem 1.5rem;
    }

    .auth-logo {
        font-size: 48px;
    }

    .customer-auth-header h1 {
        font-size: 24px;
    }
}

/* Customer Auth Page Background */
#customer-auth-page {
    background: linear-gradient(135deg, #f5f7f6 0%, #e8f0eb 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* Forgot Password Link */
.forgot-password-link {
    display: block;
    text-align: right;
    margin-top: 8px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* Password Reset Success Message */
#password-reset-success {
    margin-bottom: 1.5rem;
}

#password-reset-success strong {
    display: block;
    font-size: 16px;
    margin-bottom: 0.5rem;
}

/* ===== CUSTOMER PORTAL - INVOICE SUMMARY ===== */
.customer-invoice-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    flex: 1;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.summary-card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0f7f2 0%, #ffffff 100%);
}

.summary-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
}

/* Export Button */
.customer-invoice-actions {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.btn-export {
    background: white;
    border: 2px solid #e0e0e0;
    color: #666;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-export:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f7f2;
}

.export-icon {
    font-size: 16px;
}

/* Invoice Grid - Customer Portal */
.invoices-grid-customer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Invoice Card - Customer Portal */
.invoice-card-customer {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.invoice-card-customer:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.invoice-card-customer.overdue {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.invoice-card-customer.pending {
    border-color: #ffc107;
}

.invoice-card-customer.paid {
    opacity: 0.8;
}

.invoice-card-customer.paid:hover {
    opacity: 1;
}

/* Status Badge - Customer Portal */
.invoice-card-status {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-overdue {
    background: #f8d7da;
    color: #721c24;
}

/* Invoice Card Main Section */
.invoice-card-main {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.invoice-number {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoice-amount {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
}

/* Invoice Details */
.invoice-card-details {
    margin-bottom: 1.5rem;
}

.invoice-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.meta-icon {
    font-size: 16px;
    opacity: 0.7;
}

.text-danger {
    color: #dc3545;
    font-weight: 600;
}

/* Pay Button */
.invoice-card-action {
    margin-top: 1rem;
}

.btn-pay-invoice {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-pay-invoice:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.invoice-card-customer.overdue .btn-pay-invoice {
    background: #dc3545;
}

.invoice-card-customer.overdue .btn-pay-invoice:hover {
    background: #c82333;
}

/* Paid Mark */
.invoice-card-paid-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    font-size: 16px;
    font-weight: 700;
}

.paid-icon {
    font-size: 20px;
}

/* Empty State - Customer Portal */
.empty-state-customer {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-customer h3 {
    font-size: 24px;
    color: #2d2d2d;
    margin-bottom: 0.5rem;
}

.empty-state-customer p {
    font-size: 16px;
    color: #666;
    max-width: 400px;
    margin: 0 auto;
}

/* Mobile Responsive - Customer Portal Invoices */
@media (max-width: 768px) {
    .customer-invoice-summary {
        flex-direction: column;
    }

    .invoices-grid-customer {
        grid-template-columns: 1fr;
    }

    .invoice-amount {
        font-size: 28px;
    }

    .btn-pay-invoice {
        font-size: 14px;
        padding: 12px;
    }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 350px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.toast-error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.toast-info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

@media (max-width: 480px) {
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

#password-reset-success p {
    margin: 0;
    font-size: 14px;
}

/* Mobile */
@media (max-width: 480px) {
    #password-reset-success {
        padding: 1rem;
    }
}

/* Forgot Password Success Message */
#forgot-password-success {
    margin-bottom: 1.5rem;
}

#forgot-password-success strong {
    display: block;
    font-size: 16px;
    margin-bottom: 0.5rem;
}

#forgot-password-success p {
    margin: 0;
    font-size: 14px;
}

/* ===== 2FA STYLES ===== */

/* TOTP Input on Login Form */
.totp-input {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
    padding: 12px;
    max-width: 200px;
}

#totp-input-group,
#backup-code-input-group {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

#totp-input-group input,
#backup-code-input-group input {
    margin-bottom: 0.5rem;
}

#totp-input-group small,
#backup-code-input-group small {
    display: block;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

#totp-input-group a,
#backup-code-input-group a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

#totp-input-group a:hover,
#backup-code-input-group a:hover {
    text-decoration: underline;
}

/* Settings Section */
.settings-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

/* QR Code Container */
#qr-code-container {
    text-align: center;
    padding: 2rem;
    background: white;
    border: 2px dashed var(--border);
    border-radius: 8px;
    margin: 1rem 0;
}

#qr-code-container img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

#manual-secret {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    display: inline-block;
    margin: 0 4px;
}

/* Backup Codes Display */
.backup-codes {
    padding: 1.5rem;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    margin: 1rem 0;
}

.backup-codes p {
    margin-bottom: 1rem;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.backup-codes-grid code {
    background: white;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    display: block;
    text-align: center;
    font-weight: bold;
}

/* 2FA Setup Views */
#2fa-disabled-view p,
#2fa-enabled-view p {
    margin-bottom: 1rem;
}

#2fa-enabled-view #2fa-enabled-date {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 2FA Verification Input */
#verify-totp-token {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-family: 'Courier New', monospace;
    padding: 12px;
    max-width: 200px;
    margin: 1rem 0;
}

/* 2FA Modal */
#disable-2fa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#disable-2fa-modal.hidden {
    display: none;
}

#disable-2fa-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#disable-2fa-modal .modal-content {
    position: relative;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    z-index: 1001;
}

#disable-2fa-modal h4 {
    margin-bottom: 1rem;
    color: var(--danger);
}

#disable-2fa-modal p {
    margin-bottom: 1rem;
}

#disable-2fa-modal .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

/* Button Spacing in 2FA Views */
#2fa-setup-view button,
#2fa-backup-codes-view button,
#2fa-disabled-view button,
#2fa-enabled-view button,
#disable-2fa-modal button {
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

/* 2FA Setup Instructions */
#2fa-setup-view h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

#2fa-setup-view h4:first-child {
    margin-top: 0;
}

/* Mobile Responsive for 2FA */
@media (max-width: 768px) {
    .backup-codes-grid {
        grid-template-columns: 1fr;
    }

    .totp-input,
    #verify-totp-token {
        max-width: 100%;
        font-size: 20px;
    }

    #qr-code-container {
        padding: 1rem;
    }

    #qr-code-container img {
        max-width: 100%;
    }

    .settings-section {
        padding: 1rem;
    }
}

/* Invoice Item Cards - Phase 2 Structured Cost Tracking */
#invoice-items-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}

.invoice-item-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.invoice-item-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
}

.item-category {
    flex: 1;
    max-width: 300px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
}

.btn-remove-card {
    padding: 0.5rem 1rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-remove-card:hover:not(:disabled) {
    background: #c82333;
}

.btn-remove-card:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.item-card-body {
    padding: 1rem;
}

.item-fields-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.form-row .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row .form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

.form-row .form-group input,
.form-row .form-group select,
.form-row .form-group textarea {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
}

.item-card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.item-total-display {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.item-total-display .line-total {
    font-weight: bold;
    color: var(--primary);
}

/* Mobile responsiveness for invoice cards */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .item-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .item-category {
        max-width: 100%;
    }
}
