/* admin_style.css - All Bright White Theme */
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    /* Explicitly White */
    color: #333;
    min-height: 100vh;
}

/* Center layout for login page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
    background: #ffffff;
    /* White bg for login too */
}

/* Container for login/dashboard content */
.login-container {
    width: 90%;
    max-width: 400px;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.dashboard-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #f0f0f0;
}

h2 {
    text-align: left;
    margin-bottom: 1.5rem;
    color: #343a40;
    font-weight: 700;
}

label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: #495057;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    outline: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
    font-size: 0.95rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.7rem;
    border: none;
    border-radius: 4px;
    background: #007bff;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #0056b3;
}

.error {
    color: #dc3545;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.dashboard-container a {
    color: #007bff;
    text-decoration: none;
}

.dashboard-container a:hover {
    text-decoration: underline;
}

.logout-link {
    text-align: right;
    margin-top: 1rem;
}

.logout-link a {
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
}

/* Layout */
.main-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #ffffff;
}

.sidebar {
    width: 260px;
    background: #f8f9fa;
    /* Light Sidebar */
    color: #333;
    /* Dark Text */
    display: flex;
    flex-direction: column;
    padding: 0;
    /* Removed padding for flush look */
    flex-shrink: 0;
    border-right: 1px solid #e9ecef;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
}

.main-content,
.content-area {
    margin-left: 260px;
    padding: 2rem;
    flex: 1;
    min-height: 100vh;
    width: calc(100% - 260px);
    box-sizing: border-box;
}

.brand {
    font-size: 0.75rem;
    font-weight: 700;
    color: #495057;
    /* Match nav-header color */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.5rem 1rem;
    /* Aligned margin */
    padding: 0;
    text-align: left;
    border: none;
    display: block;
}

.nav-links {
    flex-grow: 1;
    padding: 0 1rem;
    /* Add padding to links container instead */
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    /* Increased vertical padding */
    margin-bottom: 0.2rem;
    color: #495057;
    /* Dark Gray Links */
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1em;
}

.nav-item:hover,
.nav-item.active {
    background: #e9ecef;
    /* Subtle Gray Hover */
    color: #007bff;
    /* Blue text on active */
    border-left: none;
    /* Remove border accent as requested */
}

/* Override padding/border for active item style */
.nav-item.active {
    padding-left: 1rem;
    font-weight: 700;
    background: #e3f2fd;
}


.nav-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.5rem 0 0.5rem 1rem;
    /* Aligned margin */
}

.content-area {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: #ffffff;
    /* Bright White */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    /* Slightly stronger shadow for visibility on white */
    border: 1px solid #dee2e6;
    color: #333;
}

.stat-card h3 {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 700;
}

.stat-card p {
    margin: 0.5rem 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #343a40;
}

/* Tables */
.router-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    margin-bottom: 1rem;
}

.router-table thead {
    background-color: #f1f3f5;
    /* Light Gray Header */
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.router-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.router-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    color: #333;
}

.router-table tr:last-child td {
    border-bottom: none;
}

.router-table tr:hover {
    background-color: #f8f9fa;
}

/* Buttons */
.btn-open {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #007bff;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-open:hover {
    background: #0069d9;
    transform: none;
}

.btn-settings {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #6c757d;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 10px;
    transition: background 0.2s;
}

.btn-settings:hover {
    background: #5a6268;
    transform: none;
}

.btn-edit {
    padding: 4px 8px;
    background-color: #ffc107;
    color: #212529;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #ffc107;
}

.btn-edit:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-paid {
    padding: 4px 8px;
    background-color: #28a745;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #28a745;
    margin-right: 5px;
}

.btn-paid:hover {
    background-color: #218838;
}

.btn-delete {
    padding: 4px 8px;
    background-color: #dc3545;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #dc3545;
    margin-left: 5px;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* Tags */
.tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.tag-success {
    background-color: #d4edda;
    color: #155724;
}

.tag-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.tag-warning {
    background-color: #fff3cd;
    color: #856404;
}

.tag-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* --- Responsive Mobile Design --- */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        background: #f8f9fa;
        /* Light Sidebar Mobile too */
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-top: 4rem;
    }

    .content-area {
        padding: 1rem;
        padding-top: 4rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: #ffffff;
        color: #333;
        border: 1px solid #dee2e6;
        padding: 10px;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    /* Better Mobile Table Scrolling */
    .router-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        /* Prevent wrapping unless specific cells need it */
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll on iOS */
        box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.1);
        /* Hint for scroll */
    }

    /* Improve Touch Targets */
    .nav-item {
        padding: 1rem;
        /* Larger touch area */
        font-size: 1rem;
    }

    button,
    .btn-open,
    .btn-settings {
        padding: 0.8rem 1rem;
        min-height: 44px;
        /* Minimum touch target size */
    }

    /* Adjust Card Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Adjust Headers */
    h2 {
        font-size: 1.5rem;
        /* Slightly smaller on mobile */
        margin-top: 0;
    }

    .main-content,
    .content-area {
        margin-left: 0;
        /* Reset margin */
        width: 100%;
        padding: 1rem;
        padding-top: 5rem;
        /* More space for nav toggle */
    }
}