/* Import modern Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap');

/* Modern CSS Reset and Base Styles */
:root {
    --primary-color: #60a5fa; /* Changed from #2563eb to a paler blue */
    --primary-hover: #3b82f6; /* Changed from #1d4ed8 to a slightly darker shade */
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    padding-top: 60px; /* Should match your nav height */
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
}

/* Content area styling */
.content {
    width: 100%;
    padding-top: 5px; /* Minimal top padding */
}

/* Modern Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    display: flex;
    justify-content: space-between; /* This spreads out nav-left and nav-right */
    padding: 0 20px; /* Add some padding on the sides */
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-left {
    flex-grow: 1; /* Takes up available space */
}

.nav-right {
    margin-left: auto; /* Pushes it to the right */
}

nav ul li {
    list-style: none;
    height: 100%;
    display: flex;
    align-items: center;
}

nav ul li a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    height: 100%;
}

.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropbtn {
    all: unset;
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0; /* Align dropdown to the right for user menu */
    background-color: var(--surface-color);
    min-width: 160px;
    box-shadow: var(--shadow);
    border-radius: 0.5rem;
    z-index: 1;
}

.nav-left .dropdown-content {
    right: auto; /* Reset right alignment for left nav dropdowns */
    left: 0; /* Align to the left for regular menu items */
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background-color: var(--background-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: var(--background-color);
}

/* Add a subtle separator between username and dropdown arrow */
.nav-right .dropbtn::after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 8px;
    opacity: 0.7;
}

/* Modern Container */
.container {
    width: min(1800px, 98%);  /* Match the team-container width */
    max-width: none;  /* Remove max-width restriction */
    padding: 0.5rem 1rem;  /* Reduced top/bottom padding */
    margin: 0 auto;
}

/* Modern Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    margin-bottom: 1rem; /* Reduced from 1.5rem */
}

h1 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-top: 0.5rem; /* Reduced top margin */
}

h2 {
    margin-top: 0.5rem; /* Reduced top margin */
}

/* Modern Tables */
/* Table container styles */
.table-container {
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    overflow: visible; /* Changed from auto to visible */
}

/* Table styles */
table {
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Header styles */
table thead th {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

/* Cell styles */
table td, table th {
    padding: 1rem;
    text-align: left;
}

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

/* Remove border from last row */
table tbody tr:last-child td {
    border-bottom: none;
}

/* Ensure inputs and selects in tables maintain consistent width */
table input,
table select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

/* Add some breathing room at the bottom of the content */
.content-wrapper {
    padding-bottom: 2rem;
}

/* Modern Forms */
input, select, button {
    font-family: 'Inter', sans-serif;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

button:hover {
    background-color: var(--primary-hover);
}

/* Add a secondary button style for less emphasis */
button.secondary {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

button.secondary:hover {
    background-color: #cbd5e1;
}

/* Team Boxes */
.team-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
    width: 90vw;  /* 90% of viewport width */
    margin: 0 auto;
    align-items: stretch;
}

.team-box {
    background-color: var(--surface-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    font-size: 0.875rem;  /* Slightly reduced font size for better fit */
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    margin: 1px;
    box-sizing: border-box;
}

/* Adjust text sizes for better fit in smaller boxes */
.team-box h3 {
    font-size: 0.95rem;  /* Slightly smaller heading */
    margin-bottom: 0.4rem;
}

.team-box ul {
    padding-left: 0.4rem;
}

.team-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.1);
}

.team-box h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1rem; /* Reduced heading size */
    font-weight: 600;
    margin-bottom: 0.5rem; /* Reduced margin */
}

/* Add some spacing for the content inside team boxes */
.team-box ul {
    padding-left: 0.5rem;
    margin: 0;
    list-style: none;
    flex-grow: 1;
}

.team-box li {
    margin-bottom: 0.25rem;
}

.team-box li:last-child {
    margin-bottom: 0;
}

/* Adjust form elements within team boxes */
.team-box form {
    margin-top: 0.5rem;
}

.team-box button {
    padding: 0.5rem 1rem; /* Updated to match attendance buttons */
    font-size: 1rem; /* Updated to match attendance buttons */
}

/* Adjust attendance form buttons to fit in smaller space */
.attendance-form {
    display: inline-block;
    margin-right: 0.25rem;
    padding: 1px;  /* Add 1px external padding */
}

.attendance-form button {
    padding: 0.5rem 1rem;    /* Doubled from 0.25rem 0.5rem */
    font-size: 1rem;         /* Changed from 0.75rem to 1rem (16px) */
    margin: 1px;
    color: var(--text-primary) !important;  /* Dark grey text color */
    background-color: var(--background-color);  /* Light grey background */
    border: 1px solid var(--border-color);  /* Subtle border */
}

.attendance-form button:hover {
    background-color: #e2e8f0;  /* Slightly darker grey on hover */
    color: var(--text-primary) !important;
}

/* Modify the selected state to use PaleGreen */
.attendance-form button[style*="background-color: PaleGreen"] {
    background-color: PaleGreen !important;
}

/* Status Colors */
.status-active {
    color: var(--success-color);
}

.status-inactive {
    color: var(--secondary-color);
}

/* Modern Dropdown */
.dropdown {
    position: relative;
    height: 100%; /* Match parent height */
    display: flex;
    align-items: center;
}

.dropbtn {
    all: unset; /* Reset all inherited styles */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

nav ul li.dropdown {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
}

.dropbtn {
    all: unset;
    height: 60px; /* Match navbar height */
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 60px; /* Match navbar height */
}

.dropdown {
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 60px; /* Match navbar height */
    left: 0;
    background-color: var(--surface-color);
    min-width: 160px;
    box-shadow: var(--shadow);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    z-index: 1;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: var(--background-color);
    color: var(--primary-color);
}

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

/* Calendar Container */
.calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1.5rem 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Calendar Styling */
.calendar {
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.calendar h3 {
    margin-top: 0;
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Weekday Headers */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.weekdays div {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Calendar Days */
.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

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

.day a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.day:not(:empty):hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    cursor: pointer;
}

.day.inactive {
    background-color: #ffeeee;
    border-color: #ffcccc;
}

.day.inactive a {
    color: var(--text-primary);
}

.day.inactive:hover {
    background-color: #ffdddd;
    border-color: #ffbbbb;
}

.inactive-date {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

/* Schedule Actions */
.schedule-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.schedule-actions form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.schedule-actions label {
    font-weight: 500;
}

.schedule-actions input {
    min-width: 120px;
}

@media (max-width: 768px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }
    
    .schedule-actions {
        flex-direction: column;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.small-button {
    padding: 0.5rem 1rem;    /* Doubled from 0.25rem 0.5rem */
    font-size: 1rem;         /* Changed from 0.75rem to 1rem (16px) */
    margin: 1px;
    color: var(--text-primary) !important;  /* Dark grey text color */
    background-color: var(--background-color);  /* Light grey background */
    border: 1px solid var(--border-color);  /* Subtle border */
}

.small-button:hover {
    background-color: #e2e8f0;  /* Slightly darker grey on hover */
    color: var(--text-primary) !important;
}

/* Schedule Month Blocks */
.months-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Limit to 3 boxes per row */
    gap: 20px;
    padding: 20px;
    width: 98%;
    max-width: 98%;
    margin: 0 auto;
}

.month-block {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
    min-width: 0; /* Prevents content from breaking grid */
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem; /* Slightly smaller font for better fit */
}

.schedule-table th, 
.schedule-table td {
    padding: 6px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.schedule-table th {
    background-color: var(--background-color);
    font-weight: 600;
}

.month-block h3 {
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Simplified responsive breakpoints */
@media (max-width: 1200px) {
    .months-container {
        grid-template-columns: repeat(2, 1fr); /* 2 boxes per row */
    }
}

@media (max-width: 600px) {
    .months-container {
        grid-template-columns: 1fr; /* 1 box per row */
    }
}

/* Bowler Management Specific Styles */
/* Main content wrapper */
.content-wrapper {
    margin-top: 20px;
    padding: 0 20px;
}

/* Container for the tables */
.table-container {
    margin-top: 20px;
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    overflow: auto;
}

/* Make tables fill container width */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* New bowler section */
.new-bowler-section {
    margin-bottom: 2rem;
    background-color: var(--background-color);
}

.new-bowler-section h2 {
    margin: 0;
    padding: 1rem 0;
}

/* Existing bowlers section */
.existing-bowlers-section {
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.existing-bowlers-section h2 {
    margin: 0;
    padding: 1rem 0;
    background-color: var(--background-color);
}

/* Table header styles */
.existing-bowlers-section th {
    background-color: var(--background-color);
    padding: 1rem;
    box-shadow: 0 1px 0 var(--border-color);
}

/* Table cell styles */
table td, table th {
    padding: 1rem;
    text-align: left;
}

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

/* Remove border from last row */
table tbody tr:last-child td {
    border-bottom: none;
}

/* Form controls in tables */
table input,
table select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

/* Add responsive styles */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 10px;
    }

    table td, table th {
        padding: 0.75rem;
    }
}

/* Email button styles */
.email-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.email-button:hover {
    background-color: #45a049;
}

/* Adjust the table cell to accommodate both buttons */
table td:last-child {
    white-space: nowrap;
}

/* Email all button styles - moved to top for visibility */
.email-all-section {
    margin: 1rem 0;
    display: block;  /* Make sure it's visible */
}

.email-all-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 500;
}

.email-all-button:hover {
    background-color: #45a049;
}

/* Finance Page Styles */
/* Remove finance-specific container styles since we're using .container */
/* Keep only the specific amount styling */
.total-amount {
    font-size: 0.875rem;
    color: var(--success-color);
}

.paid-to-alley-amount {
    font-size: 0.875rem;
    color: var(--warning-color);
}

.owing-amount {
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* Style for the count inputs */
.count-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.grand-total-row {
    font-weight: 600;
    background-color: var(--background-color);
}

/* Remove all other finance-specific styles as they're now handled by global table styles */

/* Settings Page Styles */
.settings-container {
    text-align: center;
}

.settings-table-container {
    display: inline-block;
    min-width: 400px;
    margin: 0 auto;
}

.settings-table-container table {
    margin: 0 auto;
}

.settings-table-container table td,
.settings-table-container table th {
    padding: 0.5rem 1rem;
}

.settings-table-container input[type="number"] {
    width: 8em;
    padding: 0.25rem 0.5rem;
}

.settings-table-container td:last-child {
    text-align: center;
}

.input-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-prefix input {
    margin-left: 0.25rem;
}

/* Team Edit Page Styles */
.team-info {
    margin-bottom: 20px;
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.team-info label {
    margin-right: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.team-info input {
    margin-right: 20px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

/* Sortable Table Styles */
.sortable-row {
    cursor: move;
}

.sort-order-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.bowler-name-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 1rem;
}

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

.save-btn:hover {
    background-color: #1ea350;
}

.back-btn {
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background-color: #4b5563;
}

.delete-bowler-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-bowler-btn:hover {
    background-color: #dc2626;
}

/* Add these new styles */
.sort-order-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-order-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.paid-positive {
    background-color: lightgreen;
}

.paid-negative {
    background-color: lightpink;
}

.paid-cell {
    padding: 4px;
}

/* Optimized report table styles for $ OWING and $ PAID reports */
.report-table {
    font-size: 0.65rem !important;
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.report-table th,
.report-table td {
    padding: 1px 2px !important;
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
    line-height: 1.1;
    overflow: hidden;
    white-space: nowrap;
}

.report-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    font-size: 0.6rem;
}

/* Column widths for optimal space usage */
.report-table .team-col {
    width: 35px;
    text-align: center;
}

.report-table .bowler-col {
    width: 90px;
    text-align: left;
    padding-left: 3px !important;
}

.report-table .date-col {
    width: 28px;
    font-size: 0.55rem;
}

.report-table .amount-col {
    width: 28px;
    font-size: 0.6rem;
}

/* Color coding for amounts */
.amount-positive {
    background-color: #90EE90;
}

.amount-negative {
    background-color: #FFB6C1;
}

/* Bowler name links in reports */
.report-table .bowler-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.65rem;
}

.report-table .bowler-link:hover {
    text-decoration: underline;
}

/* Style for bowler name links */
a.bowler-link {
    display: inline-block;
    padding: 0.625rem 1.25rem;  /* Increased from 0.5rem 1rem */
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;  /* Increased from 0.9rem */
}

a.bowler-link:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
}

/* Adjust table cells containing bowler links */
td a.bowler-link {
    padding: 0.375rem 1rem;  /* Adjusted for table context */
    white-space: nowrap;
}

/* Compact bowler link style for tracker page */
.team-box a.bowler-link {
    padding: 0.2rem 0.4rem;  /* Reduced from 0.3125rem 0.625rem */
    font-size: 0.75rem;      /* Changed from 1.06rem to 0.75rem (12px) */
    margin: 1px;
    line-height: 1.1;        /* Reduced from 1.2 to 1.1 */
}

/* Ensure consistent spacing for all buttons in team box */
.team-box form {
    padding: 1px;  /* Add 1px external padding */
}

/* Adjust team box buttons */
.team-box button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 1px;  /* Add 1px external padding */
}

/* Email button styles */
.email-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.email-button:hover {
    background-color: #45a049;
}

/* Email button styles for disabled state */
.email-button-disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    pointer-events: none;
}

.email-button-disabled:hover {
    background-color: #cccccc;
}

/* Adjust the table cell to accommodate both buttons */
table td:last-child {
    white-space: nowrap;
}

/* Email all button styles - moved to top for visibility */
.email-all-section {
    margin: 1rem 0;
    display: block;  /* Make sure it's visible */
}

.email-all-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: 500;
}

.email-all-button:hover {
    background-color: #45a049;
}

/* Finance Page Styles */
/* Remove finance-specific container styles since we're using .container */
/* Keep only the specific amount styling */
.total-amount {
    font-size: 0.875rem;
    color: var(--success-color);
}

.paid-to-alley-amount {
    font-size: 0.875rem;
    color: var(--warning-color);
}

.owing-amount {
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* Style for the count inputs */
.count-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.grand-total-row {
    font-weight: 600;
    background-color: var(--background-color);
}

/* Remove all other finance-specific styles as they're now handled by global table styles */

/* Settings Page Styles */
.settings-container {
    text-align: center;
}

.settings-table-container {
    display: inline-block;
    min-width: 400px;
    margin: 0 auto;
}

.settings-table-container table {
    margin: 0 auto;
}

.settings-table-container table td,
.settings-table-container table th {
    padding: 0.5rem 1rem;
}

.settings-table-container input[type="number"] {
    width: 8em;
    padding: 0.25rem 0.5rem;
}

.settings-table-container td:last-child {
    text-align: center;
}

.input-prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-prefix input {
    margin-left: 0.25rem;
}

/* Team Edit Page Styles */
.team-info {
    margin-bottom: 20px;
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.team-info label {
    margin-right: 10px;
    font-weight: 500;
    color: var(--text-primary);
}

.team-info input {
    margin-right: 20px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

/* Sortable Table Styles */
.sortable-row {
    cursor: move;
}

.sort-order-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.bowler-name-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 1rem;
}

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

.save-btn:hover {
    background-color: #1ea350;
}

.back-btn {
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background-color: #4b5563;
}

.delete-bowler-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-bowler-btn:hover {
    background-color: #dc2626;
}

/* Add these new styles */
.sort-order-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-order-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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



/* Style for bowler name links */
a.bowler-link {
    display: inline-block;
    padding: 0.625rem 1.25rem;  /* Increased from 0.5rem 1rem */
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;  /* Increased from 0.9rem */
}

a.bowler-link:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
}

/* Adjust table cells containing bowler links */
td a.bowler-link {
    padding: 0.375rem 1rem;  /* Adjusted for table context */
    white-space: nowrap;
}

/* Compact bowler link style for tracker page */
.team-box a.bowler-link {
    padding: 0.2rem 0.4rem;  /* Reduced from 0.3125rem 0.625rem */
    font-size: 0.75rem;      /* Changed from 1.06rem to 0.75rem (12px) */
    margin: 1px;
    line-height: 1.1;        /* Reduced from 1.2 to 1.1 */
}

/* Ensure consistent spacing for all buttons in team box */
.team-box form {
    padding: 1px;  /* Add 1px external padding */
}

/* Adjust team box buttons */
.team-box button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 1px;  /* Add 1px external padding */
}



/* Adjust the container of the name and amount to be more compact */
.team-box span {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;            /* Small gap between elements */
}

.flash-message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
}

.flash-message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.login-container .form-group {
    margin-bottom: 15px;
}

.login-container label {
    display: block;
    margin-bottom: 5px;
}

.login-container input {
    width: 100%;
    padding: 8px 12px;  /* Changed from just 8px to 8px 12px for equal left/right padding */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;  /* Added to ensure padding doesn't affect total width */
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-container button:hover {
    background-color: var(--primary-hover);
}

/* User Management Styles */
.card {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    gap: 1rem;
    max-width: 400px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--background-color);
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

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

.modal-content {
    background-color: var(--surface-color);
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Flash Messages */
.flash-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    background-color: var(--info-color);
    color: white;
}

/* Weekly Summary Styles */
.weekly-summary-container {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Reduced from 20px */
}

.weekly-summary-header {
    text-align: center;
    margin-bottom: 0; /* Added to remove extra space */
}

.weekly-summary-header h1 {
    margin-bottom: 0;
    color: #333;
}

.weekly-summary-header h2 {
    color: #666;
    font-size: 1.5rem;
    font-weight: 500;
}

.summary-stats {
    width: 98%;
    max-width: 98%;
    margin: 0 auto 10px;
    background-color: var(--background-color);
    border-radius: 5px;
    padding: 5px 10px;
}

.summary-stats table {
    width: 100%;
    table-layout: fixed; /* This helps maintain consistent column widths */
    font-size: 0.875rem;
    margin: 0;
}

.summary-stats td {
    padding: 3px 10px;
    width: 12.5%; /* Since we have 8 columns (4 label-value pairs), each gets 12.5% */
}

.summary-stats td:nth-child(even) {
    text-align: right;
}

.teams-grid {
    width: 98%;
    max-width: 98%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.team-summary-box {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.team-summary-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.team-summary-table th {
    background-color: var(--background-color);
    padding: 6px;
    text-align: left;
}

.team-summary-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--border-color);
}

.team-header {
    background-color: var(--background-color);
}

.team-header td {
    padding: 6px;
    font-weight: bold;
}

.amount-paid {
    background-color: #90EE90;
}

.amount-owing {
    background-color: #FFB6C1;
}

/* Column widths for team tables */
.col-bowler { width: 40%; }
.col-status { width: 25%; }
.col-paid { width: 15%; }
.col-owing { width: 20%; }

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

/* Print button styles */
.print-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.print-button:hover {
    background-color: #4b5563;
}

/* Print styles */
@media print {
    /* Basic page setup */
    @page {
        margin: 0.5in 1in !important; /* Reduced top/bottom margin, kept sides */
        size: letter portrait;
    }

    body {
        padding: 0 !important;
        margin: 0 auto !important;
        width: 6.5in !important;
        display: block !important;
        background-color: white !important;
    }

    /* Remove grey backgrounds */
    .team-header,
    .team-summary-table th,
    .summary-stats,
    table th {
        background-color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Keep only the specific background colors we want */
    .amount-paid {
        background-color: #90EE90 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .amount-owing {
        background-color: #FFB6C1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Remove top spacing from title */
    .weekly-summary-container {
        width: 100% !important;
        margin: 0 auto !important;
        display: block !important;
    }

    h1 {
        margin-top: 0 !important;
        margin-bottom: 0.05in !important; /* Reduced from 0.1in */
    }

    .weekly-summary-header {
        margin-top: 0 !important;
        padding-top: 0 !important;
        margin-bottom: 0 !important; /* Added to remove extra space */
    }

    /* Center all content horizontally */
    .weekly-summary-container {
        width: 100% !important;
        margin: 0 auto !important;
        /* Remove flex layout that was causing vertical centering */
        display: block !important;
    }

    /* Center the header and summary stats */
    .weekly-summary-header,
    .summary-stats {
        width: 100% !important;
        text-align: center !important;
        margin: 0 auto 0.1in auto !important; /* Reduced from 0.2in */
    }

    /* Center the teams grid */
    .teams-grid {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.15in !important; /* Reduced from 0.25in */
        margin: 0 auto !important;
        justify-content: center !important;
    }

    /* Ensure team boxes are centered */
    .team-summary-box {
        width: 3.125in !important;
        margin: 0 auto 0.05in auto !important; /* Reduced from 0.1in */
        page-break-inside: avoid !important;
        break-inside: avoid !important; /* Modern browsers */
    }

    /* Remove bottom margin from last team box */
    .team-summary-box:last-child {
        margin-bottom: 0 !important;
    }

    /* Ensure teams grid doesn't have extra bottom space */
    .teams-grid {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.15in !important;
        margin: 0 auto !important; /* Remove any bottom margin */
        padding-bottom: 0 !important;
    }

    /* Remove any bottom padding/margin from the container */
    .weekly-summary-container {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Hide the "Back to Tracker" button and ensure no space is reserved for it */
    .mt-4.no-print {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
    }

    /* Additional break control for the table itself */
    .team-summary-table {
        width: 100% !important;
        margin: 0 auto !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border-radius: 0.75rem !important;
        overflow: hidden !important; /* This is crucial for background color alignment */
        border-collapse: collapse !important;
    }

    /* Remove individual cell border radius */
    .team-summary-table th,
    .team-summary-table td {
        border-radius: 0 !important;
    }

    /* Apply background color to entire header row */
    .team-header {
        background-color: var(--background-color) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ensure background colors print correctly */
    .amount-paid {
        background-color: #90EE90 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .amount-owing {
        background-color: #FFB6C1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Apply background to entire table */
    .team-summary-table {
        background-color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Maintain column widths */
    .col-bowler { width: 45% !important; }
    .col-status { width: 30% !important; }
    .col-paid { width: 12.5% !important; }
    .col-owing { width: 12.5% !important; }

    /* Center header text */
    .team-header td {
        text-align: center !important;
    }

    /* Hide nav and no-print elements */
    .no-print,
    nav {
        display: none !important;
    }

    /* Remove extra spacing */
    .content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Ensure text doesn't wrap unnecessarily */
    .team-summary-table td {
        white-space: nowrap !important;
    }

    /* Consistent cell padding */
    .team-summary-table th,
    .team-summary-table td {
        padding: 1pt 3pt !important; /* Reduced from 2pt 3pt */
        line-height: 1.1 !important; /* Reduced from 1.2 */
    }

    /* Maintain colors only for paid/owing status */
    .amount-paid {
        background-color: #90EE90 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .amount-owing {
        background-color: #FFB6C1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Links should not be underlined in print */
    a {
        text-decoration: none !important;
    }

    /* Ensure all text is black */
    * {
        color: black !important;
    }

    /* Standardize all table text including bowler names */
    table td, 
    table th,
    table td a.bowler-link {
        font-family: 'Inter', sans-serif !important;
        font-size: 7pt !important;
        font-weight: normal !important;
        line-height: 1.2 !important;
        color: black !important;
    }

    /* Remove any special styling from bowler links */
    a.bowler-link {
        background-color: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        text-decoration: none !important;
        white-space: normal !important;
        display: inline !important;
    }

    a.bowler-link:hover {
        background-color: transparent !important;
        transform: none !important;
    }

    /* Ensure table cells with bowler links have proper spacing */
    td a.bowler-link {
        padding: 2pt 3pt !important;
    }

    /* Title and subtitle styling for print */
    .weekly-summary-header {
        text-align: center !important;
        margin-bottom: 0.2in !important;
    }

    .weekly-summary-header h1 {
        font-size: 12pt !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    .weekly-summary-header h2 {
        font-size: 9pt !important;
        margin-top: 4pt !important;
        color: #666 !important;
        text-align: center !important;
    }

    /* Ensure the print button doesn't affect centering */
    .weekly-summary-header > div {
        display: block !important;
        text-align: center !important;
    }

    .weekly-summary-header > div > div {
        display: block !important;
        text-align: center !important;
    }
}

/* Print styles for $ OWING and $ PAID reports */
@media print {
    /* Page setup for reports */
    @page {
        margin: 0.3in 0.2in !important;
        size: letter landscape;
    }

    body {
        padding: 0 !important;
        margin: 0 auto !important;
        width: 10in !important;
        display: block !important;
        background-color: white !important;
    }

    /* Hide elements not needed for print */
    .no-print,
    nav,
    .container > h1,
    .btn,
    button,
    input[type="submit"],
    .export-button,
    #exportButton {
        display: none !important;
    }

    /* Optimize report table for print */
    .report-table {
        font-size: 5pt !important;
        border-collapse: collapse !important;
        width: 100% !important;
        page-break-inside: avoid;
        margin: 0 !important;
    }

    .report-table th,
    .report-table td {
        padding: 0.5px 1px !important;
        border: 0.5px solid #000 !important;
        font-size: 5pt !important;
        line-height: 1 !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    .report-table th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
        font-size: 4.5pt !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .report-table .team-col {
        width: 25px !important;
    }

    .report-table .bowler-col {
        width: 70px !important;
        font-size: 4.5pt !important;
        text-align: left !important;
        padding-left: 2px !important;
    }

    .report-table .date-col {
        width: 20px !important;
        font-size: 4pt !important;
    }

    .report-table .amount-col {
        width: 20px !important;
        font-size: 4.5pt !important;
    }

    /* Ensure color backgrounds print */
    .amount-positive {
        background-color: #90EE90 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .amount-negative {
        background-color: #FFB6C1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Bowler links in print */
    .report-table .bowler-link {
        color: black !important;
        text-decoration: none !important;
        font-size: 4.5pt !important;
    }

    /* Report title */
    h1 {
        font-size: 12pt !important;
        margin: 5pt 0 !important;
        text-align: center !important;
    }
}

/* Tracker Page Header Styles */
.tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.tracker-title-section {
    flex-shrink: 0;
}

.tracker-title-section h1 {
    margin: 0 0 5px 0;
    font-size: 1.75rem;
    line-height: 1.2;
}

.tracker-title-section h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.2;
}

.tracker-stats {
    flex: 1;
    max-width: 400px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.stat-positive {
    background-color: #90EE90;
    padding: 2px 4px;
    border-radius: 3px;
}

.tracker-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

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

.date-selector {
    display: flex;
    gap: 4px;
    align-items: center;
}

.date-selector select {
    padding: 4px 8px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 120px;
}

.nav-buttons {
    display: flex;
    gap: 2px;
}

.compact-btn {
    padding: 4px 8px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.nav-btn {
    padding: 4px 6px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 24px;
}

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

/* Responsive adjustments for tracker header */
@media (max-width: 1024px) {
    .tracker-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .tracker-controls {
        align-items: stretch;
    }

    .date-controls {
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .tracker-header {
        gap: 10px;
    }

    .action-buttons {
        justify-content: center;
    }

    .date-controls {
        flex-direction: column;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        font-size: 0.75rem;
    }
}

/* Pot Tracking Styles */
.pot-container {
    padding: 20px;
}

.table-container {
    margin: 0;
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color); /* Add container border */
}

.pot-table {
    width: 100%;
    border-collapse: separate; /* Changed from collapse to separate */
    border-spacing: 0; /* Ensure no gaps between cells */
    margin: 0;
    background-color: var(--surface-color);
}

.pot-table th, 
.pot-table td {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

/* Remove last border-right from cells */
.pot-table th:last-child,
.pot-table td:last-child {
    border-right: none;
}

/* Remove last border-bottom from cells */
.pot-table tr:last-child td {
    border-bottom: none;
}

.pot-table th {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

/* Add top border only to first row */
.pot-table tr:first-child th {
    border-top: none;
}

/* Rounded corners */
.pot-table tr:first-child th:first-child {
    border-top-left-radius: 0.75rem;
}

.pot-table tr:first-child th:last-child {
    border-top-right-radius: 0.75rem;
}

.pot-table tr:last-child td:first-child {
    border-bottom-left-radius: 0.75rem;
}

.pot-table tr:last-child td:last-child {
    border-bottom-right-radius: 0.75rem;
}

/* Pot action buttons */
.edit-btn,
.delete-btn {
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 5px;
    min-width: 60px;  /* Set minimum width for both buttons */
}

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

.edit-btn:hover {
    background-color: #2563eb;
}

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

.delete-btn:hover {
    background-color: #dc2626;
}

/* Daily Totals Styles */
.daily-totals {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.daily-totals table {
    background-color: var(--background-color);
    border-radius: 5px;
    padding: 5px;
    width: auto;
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

.daily-totals td {
    padding: 5px 10px;
    white-space: nowrap;
}

.daily-totals td:nth-child(odd) {
    text-align: right;
}

.daily-totals td:nth-child(even) {
    min-width: 80px;
}

.daily-totals tr:first-child td {
    padding-bottom: 3px;
}

.daily-totals tr:last-child td {
    padding-top: 3px;
}

/* Modal Form Styles */
.modal .form-group {
    margin-bottom: 1.25rem;  /* Increased spacing between form groups */
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;  /* Space between label and input */
}

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.modal .form-group input[type="checkbox"] {
    width: auto;  /* Override 100% width for checkboxes */
    margin-top: 0.25rem;  /* Small space above checkbox */
}

.modal button[type="submit"] {
    margin-top: 1.5rem;  /* Space above submit button */
}

/* Settings page specific styles */
.settings-container input[type="text"] {
    padding: 8px 12px;
    width: 300px;  /* Increased width for text inputs */
    font-size: 1rem;
}

.settings-table-container table td {
    padding: 12px 16px;  /* Increased padding for table cells */
}

/* Add more vertical space after the league name field */
.settings-table-container table tr:first-child + tr td {
    padding-bottom: 24px;  /* Extra padding after the league name row */
}

/* Style the horizontal rule after league name */
.settings-table-container table hr {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Print styles for finance page */
@media print {
    /* Basic page setup - narrow margins for maximum space */
    @page {
        margin: 0.25in 0.3in !important;
        size: letter portrait;
    }

    body {
        padding: 0 !important;
        margin: 0 auto !important;
        width: 7.7in !important;
        display: block !important;
        background-color: white !important;
    }

    /* Hide elements not needed for print */
    .finance-page .no-print,
    .finance-page .weekly-cash-section,
    .finance-page h2,
    nav,
    .container > h1,
    .container > p {
        display: none !important;
    }

    /* Show only print elements */
    .finance-page .print-only {
        display: block !important;
    }

    /* Title and subtitle styling for print - ultra compact */
    .weekly-summary-header {
        text-align: center !important;
        margin-bottom: 0.1in !important;
    }

    .weekly-summary-header h1 {
        font-size: 10pt !important;
        margin-bottom: 0 !important;
        text-align: center !important;
        font-weight: bold !important;
    }

    .weekly-summary-header p {
        font-size: 8pt !important;
        margin: 2pt 0 0 0 !important;
        color: #666 !important;
        text-align: center !important;
    }

    /* Ensure the print button doesn't affect centering */
    .weekly-summary-header > div {
        display: block !important;
        text-align: center !important;
    }

    .weekly-summary-header > div > div {
        display: block !important;
        text-align: center !important;
    }

    /* Table container print styles - only show Weekly Cash History */
    .finance-page .table-container:not(.weekly-cash-history) {
        display: none !important;
    }

    .finance-page .weekly-cash-history {
        width: 100% !important;
        margin: 0 auto 0.05in auto !important;
        background-color: white !important;
        border: 0.5pt solid #000 !important;
        border-radius: 0.25rem !important;
        overflow: hidden !important;
    }

    /* Table print styles */
    .finance-page table {
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        margin: 0 !important;
    }

    .finance-page table th,
    .finance-page table td {
        padding: 2pt 3pt !important;
        font-size: 6pt !important;
        line-height: 1.0 !important;
        color: black !important;
        text-align: left !important;
        border: 0.5pt solid #000 !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    /* Hide Actions column when printing */
    .finance-page table th:last-child,
    .finance-page table td:last-child {
        display: none !important;
    }

    /* Remove double borders */
    .finance-page table th:not(:last-child),
    .finance-page table td:not(:last-child) {
        border-right: none !important;
    }

    .finance-page table tr:not(:last-child) td {
        border-bottom: none !important;
    }

    /* Rounded corners for print */
    .finance-page table tr:first-child td:first-child {
        border-top-left-radius: 0.0rem !important;
    }

    .finance-page table tr:first-child td:last-child {
        border-top-right-radius: 0.0rem !important;
    }

    .finance-page table tr:last-child td:first-child {
        border-bottom-left-radius: 0.0rem !important;
    }

    .finance-page table tr:last-child td:last-child {
        border-bottom-right-radius: 0.0rem !important;
    }

    /* Ensure backgrounds print correctly */
    .finance-page .table-container,
    .finance-page table th,
    .finance-page table td,
    .finance-page .profit-cell,
    .finance-page .next-week-cash {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Profit column styling for print */
    .finance-page .profit-cell {
        background-color: #f0f9ff !important;
        color: #0369a1 !important;
        font-weight: bold !important;
        font-size: 6pt !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    /* Next week cash column styling for print */
    .finance-page .next-week-cash {
        background-color: #f8f5ff !important;
        color: #6a1b9a !important;
        font-weight: bold !important;
        font-size: 6pt !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
    }

    /* Amount styling - ultra compact for maximum data density */
    .finance-page .total-amount,
    .finance-page .paid-to-alley-amount,
    .finance-page .gross-profit-amount,
    .finance-page .owing-amount,
    .finance-page .total-cell,
    .finance-page #grand-total {
        font-family: 'Inter', sans-serif !important;
        font-size: 6pt !important;
        color: black !important;
    }

    /* Input styling for print */
    .finance-page input.count-input {
        border: none !important;
        background: none !important;
        font-size: 9pt !important;
        color: black !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Grand total row styling */
    .finance-page .grand-total-row td {
        font-weight: bold !important;
        border-top: 1px solid #000 !important;
    }

    /* Remove any background colors except where specifically needed */
    .finance-page .table-container,
    .finance-page table th,
    .finance-page table td {
        background-color: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Finance page specific styles */
.finance-page .table-container {
    margin: 20px 0;
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.finance-page table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.finance-page table th,
.finance-page table td {
    padding: 1rem;
    text-align: left;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Remove last border-right from cells */
.finance-page table th:last-child,
.finance-page table td:last-child {
    border-right: none;
}

/* Remove last border-bottom from last row cells */
.finance-page table tr:last-child td {
    border-bottom: none;
}

/* Rounded corners for first row */
.finance-page table tr:first-child th:first-child {
    border-top-left-radius: 0.75rem;
}

.finance-page table tr:first-child th:last-child {
    border-top-right-radius: 0.75rem;
}

/* Rounded corners for last row */
.finance-page table tr:last-child td:first-child {
    border-bottom-left-radius: 0.75rem;
}

.finance-page table tr:last-child td:last-child {
    border-bottom-right-radius: 0.75rem;
}

/* Cash counter specific styles */
.finance-page .count-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.finance-page .grand-total-row {
    font-weight: bold;
}

/* Weekly profit column styling */
.profit-cell {
    font-weight: bold;
    background-color: #f0f9ff;
    color: #0369a1;
}

.profit-cell:hover {
    background-color: #e0f2fe;
}

/* Next week cash column styling */
.next-week-cash {
    font-weight: bold;
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.next-week-cash:hover {
    background-color: #e1bee7;
}

/* Print-only elements (hidden by default) */
.print-only {
    display: none;
}

/* Weekly Cash Tracking Styles */
.weekly-cash-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group input[readonly] {
    background-color: #e9ecef;
    color: #495057;
    cursor: not-allowed;
    border-color: #ced4da;
}

.form-group input[readonly]:focus {
    box-shadow: none;
    border-color: #ced4da;
}

.form-group input[readonly]:focus {
    border-color: #ced4da;
    box-shadow: none;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.save-button,
.clear-button,
.delete-button,
.edit-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.save-button {
    background-color: #28a745;
    color: white;
}

.save-button:hover {
    background-color: #218838;
}

.clear-button {
    background-color: #6c757d;
    color: white;
}

.clear-button:hover {
    background-color: #5a6268;
}

.delete-button {
    background-color: #dc3545;
    color: white;
}

.delete-button:hover {
    background-color: #c82333;
}

.edit-button {
    background-color: #007bff;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
}

.edit-button:hover {
    background-color: #0056b3;
}

#weekly-cash-table {
    font-size: 14px;
}

#weekly-cash-table th,
#weekly-cash-table td {
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

#weekly-cash-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

#weekly-cash-table tbody tr:hover {
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-group {
        min-width: unset;
    }

    .form-actions {
        flex-direction: column;
    }

    .save-button,
    .clear-button,
    .delete-button {
        width: 100%;
    }
}

/* Pre-Bowl Styles */
.pre-bowl-form {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

/* Compact form styling for add pre-bowl score */
.compact-form {
    padding: 15px 20px;
}

.compact-form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.compact-form .form-group {
    min-width: auto;
}

/* Specific widths for different field types */
.bowler-group {
    flex: 2;
    min-width: 400px;
}

.date-group {
    width: 140px;
}

.game-group {
    width: 60px;
}

.total-group {
    width: 80px;
}

.button-group {
    margin-left: 10px;
}

.compact-form .form-group label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.compact-form .form-group input,
.compact-form .form-group select {
    padding: 4px 6px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.compact-form .form-group input:focus,
.compact-form .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.compact-form .game-group input,
.compact-form .total-group input {
    text-align: center;
    width: 60px;
}

.compact-form .date-group input {
    width: 130px;
}

.compact-form .bowler-group select {
    min-width: 150px;
}

.compact-form .add-btn {
    margin-top: 0;
    padding: 8px 16px;
    font-size: 14px;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.form-group input[readonly] {
    background-color: #f8fafc;
    color: var(--text-secondary);
}

.add-btn, .save-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-btn:hover, .save-btn:hover {
    background-color: var(--primary-hover);
}

.cancel-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

.cancel-btn:hover {
    background-color: #475569;
}

.edit-btn {
    background-color: var(--warning-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
    transition: background-color 0.2s ease;
}

.edit-btn:hover {
    background-color: #d97706;
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.delete-btn:hover {
    background-color: #dc2626;
}

/* Used score styling */
.used-score {
    background-color: #f3f4f6 !important;
    color: #6b7280;
}

.used-score td {
    background-color: #f3f4f6 !important;
}

/* Inline editable fields styling */
.bowler-name-cell,
.night-bowled-cell,
.game1-cell,
.game2-cell,
.game3-cell,
.total-cell,
.date-used-cell {
    padding: 6px !important;
}

.bowler-name-input,
.night-bowled-input,
.game-input,
.total-input,
.date-used-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background-color: var(--surface-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bowler-name-input:focus,
.night-bowled-input:focus,
.game-input:focus,
.total-input:focus,
.date-used-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
}

/* Game and total inputs centered */
.game-input,
.total-input {
    text-align: center;
    width: 60px;
}

/* Total input readonly styling */
.total-input {
    background-color: #f8fafc;
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Night bowled input sizing */
.night-bowled-input {
    width: 130px;
}

/* Bowler name dropdown styling */
.bowler-name-input {
    min-width: 150px;
}

/* Used score styling for inline inputs */
.used-score .bowler-name-input,
.used-score .night-bowled-input,
.used-score .game-input,
.used-score .total-input,
.used-score .date-used-input {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.used-score .bowler-name-input:focus,
.used-score .night-bowled-input:focus,
.used-score .game-input:focus,
.used-score .date-used-input:focus {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
}

/* Keep total readonly even in used scores */
.used-score .total-input {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.used-score .total-input:focus {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}



.add-score-section,
.scores-section {
    margin-bottom: 30px;
}

.add-score-section h2,
.scores-section h2 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Filter controls styling */
.scores-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    background-color: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

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

.score-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 15px;
}

/* Responsive design for pre-bowl forms */
@media (max-width: 768px) {
    .pre-bowl-form .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .pre-bowl-form .form-group {
        min-width: auto;
    }

    .scores-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filter-controls {
        width: 100%;
        justify-content: space-between;
    }

    .score-count {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    /* Compact form responsive */
    .compact-form-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .bowler-group,
    .date-group,
    .game-group,
    .total-group {
        width: 100%;
        min-width: auto;
    }

    .button-group {
        margin-left: 0;
        margin-top: 10px;
    }

    .compact-form .add-btn {
        width: 100%;
    }
}

