@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Premium Soft Palette (Eye-friendly) */
    --primary-color: #3b82f6;
    /* Blue 500 */
    --primary-hover: #2563eb;
    /* Blue 600 */
    --sidebar-bg: #1e293b;
    /* Slate 800 */
    --sidebar-text: #cbd5e1;
    --sidebar-active: #ffffff;
    --sidebar-hover-bg: #334155;
    /* Slate 700 */

    --background-color: #f1f5f9;
    /* Slate 100 */
    /* Slate 50 */
    --surface-color: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #64748b;

    --border-color: #e2e8f0;

    --success-color: #10b981;
    /* Emerald */
    --danger-color: #ef4444;
    /* Red */
    --warning-color: #f59e0b;
    /* Amber */

    --sidebar-width: 260px;
    --header-height: 70px;

    /* Soft Premium Shadows */
    --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 -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --premium-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --radius-md: 8px;
    --radius-lg: 12px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0;
}

.btn-icon:hover {
    background: #f8fafc;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.btn-icon i {
    font-size: 0.9rem;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.premium-bg {
    background: linear-gradient(-45deg, #1e293b, #334155, #3b82f6, #6366f1);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-hover-bg);
}

.sidebar-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--premium-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.brand-text span {
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-hover-bg) var(--sidebar-bg);
}

.nav-section {
    padding: 20px 24px 8px 24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin: 4px 16px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-active);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--premium-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-icon {
    margin-right: 14px;
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
    opacity: 0.9;
}

.sidebar-footer {
    padding: 16px 0;
    border-top: 1px solid var(--sidebar-hover-bg);
    background-color: var(--sidebar-bg);
}

/* Main Content */
.main-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.top-bar {
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.content-wrapper {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background-color: #f5f8fa;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 122, 89, 0.2);
}

/* Buttons */
.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: #fff1ee;
}

.btn-danger {
    background-color: white;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background-color: #fef2f2;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    border: none;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dashboard Stats */
#dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

/* Glassmorphism Premium */
.glass-premium {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border-radius: var(--radius-lg);
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    gap: 10px;
}

.quick-action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: #fff1ee;
    transform: scale(1.05);
}

.header-actions {
    display: flex;
    gap: 15px;
}

/* Chart Canvas Wrapper */
.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Cotizaciones Specific Styles */
.quote-item-row {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#quote-total-display {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 122, 89, 0.1);
}

/* Common UI Components */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-icon.success:hover {
    color: var(--success-color);
    border-color: var(--success-color);
    background: #f0fdf4;
}

.btn-icon.danger:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: #fef2f2;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd6e2;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #f8fafc;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.1);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.search-box input {
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    width: 250px;
    transition: all 0.3s;
}

.search-box input:focus {
    width: 350px;
    outline: none;
    border-color: var(--primary-color);
}

.items-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface-color);
    padding: 28px 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
table,
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background-color: var(--background-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    background: white;
    transition: background-color 0.2s;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Rounded corners for table headers */
th:first-child {
    border-top-left-radius: 8px;
    border-left: 1px solid var(--border-color);
}

th:last-child {
    border-top-right-radius: 8px;
    border-right: 1px solid var(--border-color);
}

td:first-child {
    border-left: 1px solid var(--border-color);
}

td:last-child {
    border-right: 1px solid var(--border-color);
}

tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Login Page Specifics */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    background-color: var(--background-color);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-top: 4px solid var(--primary-color);
}

.hidden {
    display: none !important;
}

/* Utility */
.text-right {
    text-align: right;
}

.mb-4 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

/* Roles & Permissions Premium Styles */
.roles-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    height: calc(100vh - 160px);
}

.roles-sidebar,
.permissions-main {
    height: 100%;
    overflow: hidden;
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-title {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-title h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.modern-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.role-item {
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.role-item:hover {
    background: #f8fafc;
    border-color: var(--border-color);
}

.role-item.active {
    background: #fff1ee;
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.permissions-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.permission-group {
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.permission-group h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #cbd6e2;
    padding-bottom: 8px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8fafc;
    border: 2px dashed #cbd6e2;
    border-radius: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.card-header-flex {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

/* Custom Scrollbar */
.modern-list::-webkit-scrollbar,
.permissions-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.modern-list::-webkit-scrollbar-thumb,
.permissions-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd6e2;
    border-radius: 10px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.modal.modal-show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface-color);
    margin: auto;
    padding: 0;
    border-radius: 16px;
    width: auto;
    min-width: 500px;
    max-width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Invoice Module Styles */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.drop-zone {
    height: 150px;
    border: 2px dashed #cbd6e2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-color);
    background: #fff5f2;
}

.drop-zone i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 10px;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-header .close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-form {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out forwards;
    border-left: 4px solid #cbd6e2;
    opacity: 0;
    transform: translateX(100%);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

.toast-content {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 240px;
        /* Keep same width, but hide it */
    }

    /* Sidebar Hidden by Default */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 70%;
        /* Wider on very small screens? No, keep fixed or max-width */
        max-width: 300px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Main Content expands */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Top Bar adjustments */
    .top-bar {
        padding: 0 15px;
    }

    /* Hamburger Menu */
    .mobile-menu-btn {
        display: block !important;
        /* Visible on mobile */
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 1.5rem;
        cursor: pointer;
        margin-right: 15px;
    }

    /* Stats Grid */
    .stats-overview {
        grid-template-columns: 1fr;
        /* Stack 1 column */
    }

    #dashboard-stats {
        grid-template-columns: 1fr;
    }

    /* Tables scrollable */
    .table-responsive {
        overflow-x: auto;
        display: block;
    }

    /* Social Media specific */
    .fc-header-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    /* Adjust Modal */
    .modal-content {
        width: 90% !important;
        margin: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .glass-premium {
        margin: 10px 0;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Modern Toggle Switch for Permissions */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--success-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--success-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Premium Permission Items */
.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.permission-item:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.permission-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.permission-icon-box {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.permission-item:hover .permission-icon-box {
    background: var(--primary-color);
    color: white;
}

.permission-label-text {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Redesigning Permission Cards */
.permission-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.permission-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.permission-card-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.permission-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* empty state improvement */
.empty-illustration {
    width: 120px;
    height: 120px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    color: var(--primary-color);
    opacity: 0.6;
}

/* Ensure hamburger is hidden on desktop */
.mobile-menu-btn {
    display: none;
}