/* style.css (NEW MODERN VERSION 8 - Pill Tabs) */

/* --- 1. Global Styles & Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
    font-size: 16px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* --- 2. New Header/Navigation Bar --- */
header.main-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
    text-decoration: none;
    color: white;
}
.logo span {
    color: #007bff;
}

nav.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav.main-nav span {
    font-size: 0.9em;
    color: #ecf0f1;
}

nav.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

nav.main-nav a.nav-logout:hover {
    background-color: #c0392b;
}

/* --- 3. Typography --- */
h1, h2, h3, h4 {
    color: #111;
    font-weight: 700;
    margin-top: 0;
}
h1 { font-size: 2.2em; margin-bottom: 20px; }
h2 { font-size: 1.8em; margin-bottom: 15px; }
h3 { font-size: 1.4em; margin-bottom: 10px; }

hr {
    border: 0;
    height: 1px;
    background-color: #e0e0e0;
    margin: 30px 0;
}

/* --- 4. Forms & Buttons --- */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    margin: 8px 0 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}
input:focus, select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
    outline: none;
}

button, input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
button:hover, input[type="submit"]:hover {
    background-color: #0056b3;
}
button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- 5. Alerts & Cards --- */
.error {
    color: #D8000C;
    background-color: #FFD2D2;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #D8000C;
}
.success {
    color: #4F8A10;
    background-color: #DFF2BF;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #4F8A10;
}

/* --- 6. Table & Tool Layouts --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    border-bottom: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}
th {
    background-color: #f9f9f9;
    font-weight: 500;
    color: #333;
}
td {
    font-size: 0.95em;
}
tr:last-child td {
    border-bottom: 0;
}

.login-box {
    max-width: 450px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.jump-tool, .admin-section, .tool-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

/* --- 7. Modal & Action Buttons --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    padding-top: 60px;
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-content h3 {
    margin-top: 0;
}
.modal-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.modal-form-grid .form-group {
    flex: 1;
    min-width: 200px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin: 10px 0 30px 0;
}
.action-buttons button {
    flex: 1;
    font-size: 1.1em;
    font-weight: 700;
    padding: 15px;
}
.btn-sale {
    background-color: #28a745;
}
.btn-sale:hover {
    background-color: #218838;
}
.btn-payout {
    background-color: #dc3545;
}
.btn-payout:hover {
    background-color: #c82333;
}

/* --- 8. Collapsible Details --- */
details {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    margin-top: 30px; /* Add space above details */
}
details summary {
    padding: 15px 20px;
    font-size: 1.4em;
    font-weight: 700;
    cursor: pointer;
    list-style: none; /* Remove default triangle */
    outline: none; /* Remove focus outline */
}
details summary::before {
    content: '► '; /* Collapsed icon */
    font-size: 0.8em;
    margin-right: 8px;
}
details[open] summary {
    border-bottom: 1px solid #e0e0e0; /* Separator when open */
}
details[open] summary::before {
    content: '▼ '; /* Expanded icon */
}
details[open] .tools-grid {
    padding: 20px; /* Padding for the content */
    margin-top: 0;
}

/* --- 9. Tab Navigation --- (IMPROVED Pill Style) */
.tab-nav {
    display: flex;
    background-color: #e9ecef; /* Light grey background for the container */
    border-radius: 8px; /* Rounded container */
    padding: 4px; /* Small padding around the buttons */
    margin-bottom: 25px;
}
.tab-nav button {
    flex: 1; /* Make all buttons equal width */
    padding: 8px 12px; /* Smaller padding */
    cursor: pointer;
    border: none;
    background-color: transparent; /* Inactive tabs are transparent */
    font-size: 0.95em; /* Smaller font */
    font-weight: 600; /* Bold */
    color: #555;
    border-radius: 6px; /* Rounded corners for the pill effect */
    transition: all 0.2s ease-in-out;
    outline: none; /* Remove focus outline */
}
.tab-nav button:hover {
    background-color: #dee2e6; /* Subtle hover for inactive tabs */
    color: #000;
}
.tab-nav button.active {
    background-color: #fff; /* Active tab is white */
    color: #007bff;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Give active tab a slight lift */
}
.tab-content {
    display: none; /* Hide all tab content by default */
}
.tab-content.active {
    display: block; /* Show the active tab content */
}

/* --- 10. Mini Stats Bar --- */
.mini-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.stat-item {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 5px 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
    min-width: 150px;
}
.stat-item small {
    font-size: 0.75em;
    color: #555;
    font-weight: 500;
    margin-bottom: 2px;
    text-transform: uppercase;
}
.stat-item .value {
    font-size: 1.1em;
    font-weight: 700;
}
.stat-item .value.editable { /* Make editable values look clickable */
    cursor: pointer;
    text-decoration: underline dotted; /* Subtle indicator */
    text-decoration-color: #aaa;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.stat-item .value.editable:hover {
    text-decoration-color: #007bff;
    color: #0056b3;
}

/* Colors for stats */
.stat-item.merchant .value { color: #D9534F; }
.stat-item.bank .value { color: #5CB85C; }
.stat-item.sales .value { color: #007bff; }