:root {
    --primary-bg: #1a1a2e;
    --accent-blue: #00d2ff;
    --text-light: #ffffff;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    display: flex;
    background: #f0f4f8;
    color: #333;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    background: var(--primary-bg);
    color: var(--text-light);
    z-index: 1000;
}

.sidebar h2 {
    text-align: center;
    padding: 30px 0;
    color: var(--accent-blue);
    letter-spacing: 2px;
}

.sidebar ul li {
    padding: 15px 25px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid transparent;
}

.sidebar ul li:hover,
.active-link {
    background: rgba(0, 210, 255, 0.15);
    color: var(--accent-blue);
    border-left: 4px solid var(--accent-blue);
    font-weight: bold;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 40px;
    width: calc(100% - 250px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    padding: 30px;
    border-radius: 15px;
    color: white;
    text-align: center;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card:hover {
    transform: translateY(-10px);
    filter: brightness(1.1);
}

.card:active {
    transform: scale(0.95);
}

.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.green {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.gold {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

/* Tables */
.data-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* Filter Radio Buttons */
/* ================= MODERN RADIO PILLS ================= */

.filter-radios.modern {
    display: inline-flex;
    gap: 12px;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.radio-pill {
    position: relative;
}

.radio-pill input {
    display: none;
}

.radio-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Hover */
.radio-pill span:hover {
    color: var(--accent-blue);
}

/* Checked State */
.radio-pill input:checked + span {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.35);
}

/* Smooth press effect */
.radio-pill input:checked + span:active {
    transform: scale(0.96);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .filter-radios.modern {
        width: 100%;
        justify-content: space-between;
    }

    .radio-pill span {
        flex: 1;
        text-align: center;
        padding: 10px 0;
    }
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

th {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Buttons */
button,
select {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

/* Styled Select Dropdown for History */
select {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-size: 0.95rem;
    padding: 12px 35px 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);  
    appearance: none;
    /* background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); */
    /* background-repeat: no-repeat; */
    /* background-position: right 12px center; */
    /* background-size: 18px; */
    transition: all 0.3s ease;
}

select:hover {
    background: linear-gradient(135deg, #2980b9, #1e5f8c);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

select:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

select option {
    background: white;
    color: #333;
    padding: 10px;
}

.btn-add {
    background: #27ae60;
    color: white;
}

.btn-add:hover {
    background: #219150;
}

.btn-refresh {
    background: #34495e;
    color: white;
}

.btn-refresh:hover {
    background: #2c3e50;
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
}

/* Icon-only Buttons for Tables */
.btn-icon {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-right: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.btn-icon:last-child {
    margin-right: 0;
}

.btn-icon-edit {
    background: #3498db;
    color: white;
}

.btn-icon-edit:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-icon-delete {
    background: #e74c3c;
    color: white;
}

.btn-icon-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

.btn-icon:active {
    transform: translateY(0);
}

/* Status Pills */
.status-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.status-pill.active {
    background: #e1f7e9;
    color: #27ae60;
}

.status-pill.expired {
    background: #ffebee;
    color: #e74c3c;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    font-size: 0.95rem;
}

.form-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 5px rgba(0, 210, 255, 0.2);
}

.form-group input:read-only {
    background: #f5f5f5;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

/* Revenue Modal Fix */
.revenue-modal {
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #e74c3c;
}

.revenue-total {
    text-align: center;
    font-size: 1.6rem;
    margin: 10px 0;
    color: #27ae60;
    font-weight: bold;
}

.table-scroll {
    overflow-y: auto;
    flex: 1;
}

.table-scroll table {
    width: 100%;
    border-collapse: collapse;
}

.table-scroll th,
.table-scroll td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-radios {
        width: 100%;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ================= ACTION BUTTON CROPPING FIX ================= */

/* =========================================================
   FINAL ACTION BUTTON FIX — NO CROPPING, NO SCROLLBAR
   ========================================================= */

/* Keep table natural */
/* =========================================================
   FINAL ACTION BUTTON FIX — NO CROPPING, NO SCROLLBAR
   ========================================================= */

/* Keep table natural */
table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

/* Action column header - smaller fixed width */
th:last-child {
    text-align: center;
    white-space: nowrap;
    width: 80px;
    max-width: none; /* Remove max-width restriction */
}

/* Action column cell - smaller and allow content to be visible */
td:last-child {
    text-align: center;
    white-space: nowrap;
    width: 80px;
    max-width: none; /* Remove max-width restriction */
    overflow: visible; /* Allow buttons to show fully */
    position: relative;
    padding: 8px 5px !important;
}

/* Wrap buttons safely */
td:last-child > * {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

/* Icon buttons - smaller size */
.btn-icon {
    flex-shrink: 0;
    padding: 4px 4px;
    font-size: 0.75rem;
    width: 80%;
    max-width: 70px;
    border-radius: 20px;
}

/* Text buttons (update/delete screens) */
.btn-add,
.btn-delete {
    flex-shrink: 0;
}

/* No horizontal scroll */
.table-responsive {
    overflow-x: visible;
    overflow-y: visible;
}

/* ================= MOBILE SAFE ================= */

@media (max-width: 768px) {
    td:last-child > * {
        gap: 12px;
    }
}

/* Search Bar Styling */
.search-bar-modern {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 8px 15px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.search-bar-modern:focus-within {
    background: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.2);
}

.search-bar-modern i {
    color: #94a3b8;
    margin-right: 10px;
    font-size: 0.9rem;
}

.search-bar-modern input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: #334155;
    width: 180px; /* Adjust width as needed */
}

/* Ensure header elements align correctly */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}