body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
}

.hidden {
    display: none !important;
}

#login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at top, rgba(0, 97, 255, 0.05) 0%, transparent 50%);
}

#login-form,
#forgot-password-form,
#reset-password-form,
.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 2px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
    width: 360px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#login-form input,
#forgot-password-form input,
#reset-password-form input,
#login-form select {
    display: block;
    margin: 12px 0;
    padding: 12px 16px;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s;
}

#login-form input:focus,
#forgot-password-form input:focus,
#reset-password-form input:focus {
    outline: none;
    border-color: #0061ff;
    box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.1);
}

#login-form button,
#forgot-password-form button,
#reset-password-form button,
.auth-box button {
    width: 100%;
    background: #0061ff;
    color: white;
    padding: 12px;
    border-radius: 2px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    margin-top: 10px;
}

#login-form button:hover,
#forgot-password-form button:hover,
#reset-password-form button:hover,
.auth-box button:hover {
    background: #0056e0;
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 15px;
    text-align: center;
}

.login-footer a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.lang-selector-wrapper {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

hr {
    width: 100%;
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

#reset-message {
    margin-top: 20px;
    color: #27ae60;
    font-weight: bold;
}

#login-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    min-height: 1.2em;
}

#admin-container {
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 200px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #34495e;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
    cursor: pointer;
}

.user-info {
    text-align: center;
    margin-bottom: 10px;
}

.user-name {
    font-weight: bold;
    display: block;
}

.user-email {
    font-size: 0.8rem;
    color: #bdc3c7;
}

.sidebar-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.sidebar-actions button#logout-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-bottom: 0;
}

.sidebar-actions button#logout-btn:hover {
    background-color: #c0392b;
}

.sidebar-actions button#my-account-btn {
    flex-grow: 1;
    margin-bottom: 0;
}

#sidebar ul {
    list-style: none;
    padding: 0;
    flex-grow: 1;
    overflow-y: auto;
    margin: 0;
}

#sidebar li {
    padding: 10px;
    cursor: pointer;
}

#sidebar li:hover {
    background-color: #34495e;
}

#main-content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    transition: flex 0.3s ease;
}

#admin-container.aside-open #main-content {
    flex: 0 0 40%;
}

/* Edit Aside Styles */
#edit-aside {
    position: fixed;
    top: 0;
    right: 0;
    width: 60%;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 0;
}

#edit-aside.visible {
    transform: translateX(0);
}

#admin-container.aside-open #edit-aside {
    display: flex !important;
    /* Override hidden if needed */
}

.aside-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#aside-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

#aside-form-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.aside-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn.secondary {
    background-color: #bdc3c7;
}

.btn.primary {
    background-color: #3498db;
}

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

#aside-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

#aside-form-container input,
#aside-form-container select,
#aside-form-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #CECECE;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    background: white;
}

.id-field-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.id-field {
    flex: 1;
    background-color: #f5f5f5 !important;
    cursor: default;
}

.copy-id-btn {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.copy-id-btn:hover {
    background-color: #2980b9;
}

.copy-id-btn i.fa-check {
    color: #27ae60;
}

#aside-form-container textarea {
    resize: vertical;
    font-family: inherit;
}

@media (max-width: 768px) {
    #admin-container.aside-open #main-content {
        display: none;
        /* Hide main on mobile when editing */
    }

    #edit-aside {
        width: 100%;
    }
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #CECECE;
}

th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 2px solid #CECECE;
    position: relative;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    padding-right: 25px;
}

th.sortable:hover {
    background-color: #e9ecef;
}

th.sortable::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 8px;
    color: #bdc3c7;
    font-size: 0.7rem;
}

th.sort-asc::after {
    content: '\f0de';
    color: #3498db;
}

th.sort-desc::after {
    content: '\f0dd';
    color: #3498db;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Align Actions column to the right */
th:last-child,
td:last-child {
    text-align: right;
}

/* Action buttons in table */
button.edit,
button.delete {
    padding: 8px 14px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

button.edit {
    background-color: #3498db;
    color: white;
}

button.edit:hover {
    background-color: #2980b9;
}

/* Unified delete buttons */
button.delete,
button.delete-btn,
button.btn-delete,
button.delete-tree-btn,
button.delete-assignment,
button.delete-scope,
button.btn-remove,
button.btn-remove-day,
button.btn-remove-special,
button#delete-event-btn,
button#delete-role-btn,
button#delete-cal-btn,
button#delete-unit-btn {
    background: transparent;
    color: #ef4444;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
}

button.delete i,
button.delete-btn i,
button.btn-delete i,
button.delete-tree-btn i,
button.delete-assignment i,
button.delete-scope i,
button.btn-remove i,
button.btn-remove-day i,
button.btn-remove-special i,
button#delete-event-btn i,
button#delete-role-btn i,
button#delete-cal-btn i,
button#delete-unit-btn i {
    color: currentColor;
}

button.delete:hover,
button.delete-btn:hover,
button.btn-delete:hover,
button.delete-tree-btn:hover,
button.delete-assignment:hover,
button.delete-scope:hover,
button.btn-remove:hover,
button.btn-remove-day:hover,
button.btn-remove-special:hover,
button#delete-event-btn:hover,
button#delete-role-btn:hover,
button#delete-cal-btn:hover,
button#delete-unit-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* General Button Styles */
button,
.btn {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background-color: #2c3e50;
    color: white;
    font-size: 1rem;
}


button:hover {
    background-color: #34495e;
}

/* Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.stat-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    color: #3498db;
}

.stat-info h3 {
    margin: 0 0 5px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.stat-info p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.chart-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}


/* Table Action Styles */
.desktop-actions {
    display: inline-block;
}

.mobile-actions {
    display: none;
    position: relative;
    text-align: right;
}

.action-menu-btn {
    background: none;
    border: none;
    color: #2c3e50;
    font-size: 1.2rem;
    padding: 5px;
    cursor: pointer;
}

.action-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
    display: flex;
    flex-direction: column;
    width: 120px;
    text-align: left;
}

.action-dropdown button {
    background: none;
    border: none;
    color: #333;
    padding: 10px;
    text-align: left;
    width: 100%;
    border-radius: 0;
}

.action-dropdown button:hover {
    background-color: #f1f1f1;
}

.action-dropdown.hidden {
    display: none !important;
}

/* Mobile Utilities */
.mobile-only {
    display: none;
}

/* Sidebar Icons */
#sidebar ul li i,
#mobile-overflow-menu ul li i {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
        /* or flex depending on context */
    }

    /* Hide desktop elements */
    .desktop-only,
    .desktop-only-item,
    .desktop-actions {
        display: none !important;
    }

    /* Show mobile actions */
    .mobile-actions {
        display: block;
    }

    /* Reduce table cell padding on mobile */
    th,
    td {
        padding: 8px 5px;
        font-size: 0.9rem;
    }

    /* Optional: Hide less important columns on very small screens if needed, 
       but for now we just handle actions */

    /* Layout adjustments */
    #admin-container {
        flex-direction: column;
    }

    #main-content {
        margin-bottom: 70px;
        /* Space for bottom bar */
        padding-bottom: 80px;
    }

    /* Transform Sidebar to Bottom Bar */
    #sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        /* Fixed height */
        padding: 0;
        flex-direction: row;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    #sidebar h2,
    .sidebar-user {
        display: none;
    }

    #sidebar ul {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        margin: 0;
        padding: 0;
    }

    #sidebar li {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 5px;
        font-size: 0.7rem;
        flex: 1;
        height: 100%;
        border-bottom: none;
        /* Reset desktop styles if any */
    }

    #sidebar li:hover {
        background-color: #34495e;
    }

    #sidebar ul li i {
        margin-right: 0;
        margin-bottom: 4px;
        font-size: 1.2rem;
    }

    /* Items beyond 4 are hidden in the main bar, but handled via specific classes in HTML for now 
       to align with the specific "4 items + more" requirement.
       We specifically hid .desktop-only-item in CSS above.
    */

    /* Mobile Overflow Menu */
    #mobile-overflow-menu {
        position: fixed;
        bottom: 70px;
        /* Above the nav bar */
        right: 10px;
        width: 200px;
        background-color: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        z-index: 1100;
        padding: 10px 0;
    }

    #mobile-overflow-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #mobile-overflow-menu li {
        padding: 12px 20px;
        display: flex;
        align-items: center;
        color: #2c3e50;
        cursor: pointer;
        border-bottom: 1px solid #f1f1f1;
    }

    #mobile-overflow-menu li:last-child {
        border-bottom: none;
    }

    #mobile-overflow-menu li:hover {
        background-color: #f8f9fa;
    }

    #mobile-overflow-menu li i {
        color: #2c3e50;
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
}

/* Account Page Styles */
.account-summary {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.user-details-card,
.billing-block {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.simple-table {
    width: 100%;
    margin-bottom: 15px;
    border-collapse: collapse;
}

.simple-table th,
.simple-table td {
    border-bottom: 1px solid #eee;
    padding: 10px;
    text-align: left;
}

.simple-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

/* Translations specific */
.missing {
    color: #e74c3c;
    opacity: 0.5;
    font-size: 0.8rem;
}

.token-translations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.bold {
    font-weight: bold;
}

/* Switch Toggle Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2ecc71;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2ecc71;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* User Roles Table Styles in Aside */
.roles-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.roles-table th,
.roles-table td {
    border-bottom: 1px solid #eee;
    padding: 8px;
    text-align: left;
}

.roles-table th {
    background-color: #f8f9fa;
}
