/* public/assets/css/style.css */
:root {
    --primary: #f7b655;
    --primary-hover: #f7941d;
    --secondary: #d01919;
    --secondary-hover: #b61515;
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(51, 65, 85, 0.8);
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-color);
}

/* Typography & Links */
a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3 {
    font-weight: 800;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    /* Added for mobile accordion */
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-menu {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.navbar-account {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.navbar-menu a {
    color: #cbd5e1;
    margin-left: 1.5rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.navbar-menu a:hover {
    color: white;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(185, 145, 75, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5 !important;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.4);
    color: white !important;
}

/* Containers & Glass Panels */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.glass-panel,
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #e2e8f0;
    font-weight: 400;
}

.form-control,
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus,
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(241, 189, 99, 0.4);
    background: rgba(15, 23, 42, 0.8);
}

/* Alerts */
.alert {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem;
    margin: 0 0 30px 0;
    border-radius: 10px;
    font-size: 0.875rem;
    text-align: center;
    transition: opacity 0.3s ease;
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

th {
    color: #94a3b8;
    font-weight: 600;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
}

.badge-admin {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Specific Views */

/* Login View */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    display: flex;
    margin: 0 auto;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.logo p {
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 300;
}

/* Dashboard View */
.hero {
    text-align: center;
    margin: 2rem 0 4rem 0;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    color: #94a3b8;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    color: white;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.service-card:nth-child(1) {
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation-delay: 0.3s;
}

.service-card:nth-child(4) {
    animation-delay: 0.4s;
}

.service-card:hover {
    transform: translateY(-8px);
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a855f7;
    font-size: 1.8rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.service-badges {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.service-card:hover .service-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    transform: scale(1.1);
}

.service-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-url {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: auto;
    word-break: break-all;
}

/* Admin View */
.admin-layout {
    display: flex;
    flex-wrap: nowrap;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1rem;
    backdrop-filter: blur(10px);
}

.admin-sidebar h2 {
    margin-bottom: 2rem;
    padding-left: 1rem;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-heading {
    margin: 1.25rem 0 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    color: #cbd5e1;
    border-radius: 8px;
    margin-bottom: 0.2rem;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
}

.admin-sidebar .nav-link.nav-sub-link {
    padding-left: 2rem;
    font-size: 0.84rem;
    opacity: 0.9;
}

.admin-sidebar .nav-link .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
}

.admin-sidebar .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 0.95rem;
    color: #94a3b8;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.admin-sidebar .nav-link:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #ffffff;
}

.admin-sidebar .nav-link:hover i {
    color: var(--accent-color, #60a5fa);
}

.admin-sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.05));
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid var(--accent-color, #3b82f6);
}

.admin-sidebar .nav-link.active i {
    color: var(--accent-color, #60a5fa);
}

.sidebar-badge {
    margin-left: auto;
    background: var(--primary, #ef4444);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.admin-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 4rem;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar Collapsed State */
.admin-layout.sidebar-collapsed .admin-sidebar {
    width: 80px;
    padding: 2rem 0.5rem;
}

.admin-layout.sidebar-collapsed .admin-sidebar .sidebar-heading,
.admin-layout.sidebar-collapsed .admin-sidebar .nav-link span:not(.nav-icon),
.admin-layout.sidebar-collapsed .admin-sidebar .sidebar-badge {
    display: none !important;
}

.admin-layout.sidebar-collapsed .admin-sidebar .nav-link {
    justify-content: center;
    padding: 0.85rem 0;
}

.admin-layout.sidebar-collapsed .admin-sidebar .nav-link .nav-icon,
.admin-layout.sidebar-collapsed .admin-sidebar .nav-link i {
    display: inline-flex !important;
    font-size: 1.4rem;
    width: auto;
    margin: 0 auto;
}

.admin-layout.sidebar-collapsed .admin-sidebar h2,
.admin-layout.sidebar-collapsed .admin-sidebar .btn-back,
.admin-layout.sidebar-collapsed .admin-sidebar img {
    display: none;
}

.admin-layout.sidebar-collapsed .admin-sidebar .logo-small {
    display: block !important;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    padding-top: 1rem;
}

.admin-sidebar .logo-small {
    display: none;
}

/* Collapsible Cards */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* Personal Notes Highlight */
.btn-note.personal.active {
    background: rgba(245, 158, 11, 0.2) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
    animation: pulse-note 2s infinite;
}

@keyframes pulse-note {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.card-header h2 {
    margin-bottom: 0;
}

.card-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem;
    color: #94a3b8;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.card.collapsed .card-toggle {
    transform: rotate(-90deg);
}

.card.collapsed>*:not(.card-header) {
    display: none;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-back {
    color: var(--primary);
    font-weight: 600;
    margin: 0 0 2rem 0;
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

/* News Section Styles */
article {
    transition: transform 0.3s ease;
}

article:hover {
    transform: translateX(5px);
}

article h4 {
    color: white;
    font-weight: 600;
}

/* Portal Search & Controls */
.portal-controls {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 50;
}

.view-btn {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.view-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px -5px var(--primary);
}

/* Role Dropdown Button & Menu */
.role-dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 60;
}

.btn-role-dropdown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-role-dropdown:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-role-dropdown.has-filter {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.role-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: 180px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 0.35rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
    z-index: 9999;
}

.role-dropdown-menu.show {
    display: block;
}

.role-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.role-option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.role-option-btn.active {
    color: #fff;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
}

.role-option-btn .role-check {
    font-size: 0.75rem;
    color: #3b82f6;
    display: none;
}

.role-option-btn.active .role-check {
    display: inline;
}

/* Service Card Wrapper (Handles Favorite Button & Layout modes) */
/* Service Card Wrapper */
.service-card-wrapper {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
}

.service-card-wrapper:hover {
    transform: translateY(-8px);
}

/* Highlight Service Styling */
.service-card-wrapper.highlight-service .service-card {
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(247, 182, 85, 0.25);
}

/* Hint Badge */
.hint-badge {
    position: absolute;
    top: 10px;
    left: 15px;
    background: var(--secondary);
    color: white;
    padding: 2px 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 4px;
    z-index: 20;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.service-card {
    display: flex;
    padding: 1.8rem;
    gap: 0.2rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.fav-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.fav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.fav-toggle.active {
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.2);
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 15px -5px rgba(0, 0, 0, 0.5);
}

.service-details {
    flex: 1;
    min-width: 0;
    /* Critical for ellipsis to work in flexbox */
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.service-name {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.empty-state,
.empty-state-permanent {
    text-align: center;
    padding: 3rem;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: 15px;
    color: #94a3b8;
    margin-bottom: 2rem;
}

.empty-state h3,
.empty-state-permanent h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.service-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.5;
    /* Multiline ellipsis (2 lines) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-url {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

/* --- LIST MODE --- */
.services-grid[data-mode="list"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
}

.services-grid[data-mode="list"] .service-card {
    padding: 0.6rem 1.2rem;
    gap: 1.2rem;
    flex-direction: row;
    height: auto;
    min-height: 50px;
    border-radius: 10px;
}

.services-grid[data-mode="list"] .service-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    margin: 0;
    border-radius: 6px;
    box-shadow: none;
}

.services-grid[data-mode="list"] .service-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.services-grid[data-mode="list"] .service-header {
    margin-bottom: 0px;
}

.services-grid[data-mode="list"] .service-desc {
    display: none;
}

.services-grid[data-mode="list"] .service-url {
    text-align: left;
    margin-left: 0;
    font-size: 0.75rem;
    opacity: 0.7;
}

.services-grid[data-mode="list"] .fav-toggle {
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    width: 28px;
    height: 28px;
    font-size: 1rem;
}

.services-grid[data-mode="list"] .service-badges {
    position: absolute;
    left: auto;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0;
}

.services-grid[data-mode="list"] .service-badges .badge {
    margin: 0;
}

.services-grid[data-mode="list"] .hint-badge {
    left: auto;
    text-align: right;
    right: 160px;
    top: 50%;
    transform: translateY(-50%);
}

/* --- COMPACT MODE --- */
.services-grid[data-mode="compact"] {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 0.6rem !important;
}

.services-grid[data-mode="compact"] .service-card {
    padding: 0.6rem 0.8rem;
    gap: 0.8rem;
}

.services-grid[data-mode="compact"] .service-icon {
    width: 24px;
    height: 24px;
    margin: 0;
    font-size: 0.8rem;
    border-radius: 4px;
}

.services-grid[data-mode="compact"] .service-name {
    font-size: 1rem;
    font-weight: 700;
    white-space: normal;
    /* Allow wrapping */
}

.services-grid[data-mode="compact"] .service-desc,
.services-grid[data-mode="compact"] .service-url,
.services-grid[data-mode="compact"] .service-badges {
    display: none;
}

.services-grid[data-mode="compact"] .fav-toggle {
    display: flex;
    width: 22px;
    height: 22px;
    font-size: 0.8rem;
    top: 5px;
    right: 5px;
}

.services-grid[data-mode="compact"] .hint-badge {
    font-size: 0.5rem;
    padding: 1px 5px;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: 5px;
}

/* --- GRID MODE (Default) --- */
.services-grid[data-mode="grid"] {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Category Headers */
.category-title {
    color: var(--primary);
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    font-weight: 800;
}

/* Responsive adjustments for the new portal layout */
@media (max-width: 1100px) {
    .container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    aside {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
    }

    .navbar-left {
        width: 100%;
    }

    .menu-toggle {
        display: flex;
    }

    .navbar-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 1.5rem;
        padding-bottom: 1rem;
        gap: 1.5rem;
        text-align: center;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        margin-top: 1rem;
        animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .navbar-account {
        margin-left: 0;
        flex-direction: column;
        gap: 1rem;
    }

    .navbar-menu.active {
        display: flex;
        /* Show when toggle is clicked */
    }

    .navbar-menu a,
    .navbar-menu span {
        margin: 0 !important;
        width: 100%;
    }

    .navbar-menu form {
        margin-right: 0 !important;
        width: 100%;
    }

    .navbar-menu select {
        width: 100%;
        text-align: center;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================================================
   Responsive Admin Panel Optimizations
   ========================================================================== */
.admin-mobile-topbar {
    display: none;
}

.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9998;
}

@media (max-width: 991px) {
    .admin-layout {
        flex-direction: column !important;
        min-height: 100vh;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        position: relative;
    }

    .admin-mobile-topbar {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        background: #0f172a;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 0;
        z-index: 999;
        width: 100%;
        box-sizing: border-box;
    }

    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 290px !important;
        max-width: 85vw !important;
        z-index: 10000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.8) !important;
        padding: 1.5rem 1rem !important;
        background: #0f172a !important;
        overflow-y: auto !important;
        display: block !important;
    }

    /* In mobile drawer mode, always show full headings and labels */
    .admin-sidebar .sidebar-heading,
    .admin-sidebar .nav-link span:not(.nav-icon),
    .admin-sidebar .sidebar-badge {
        display: block !important;
    }

    .admin-sidebar .nav-link {
        justify-content: flex-start !important;
        padding: 0.65rem 0.85rem !important;
    }

    .admin-sidebar h2,
    .admin-sidebar .btn-back,
    .admin-sidebar img {
        display: block !important;
    }

    .admin-sidebar .logo-small {
        display: none !important;
    }

    .admin-layout.sidebar-mobile-open .admin-sidebar {
        transform: translateX(0) !important;
    }

    .admin-layout.sidebar-mobile-open .admin-sidebar-backdrop {
        display: block !important;
    }

    .admin-content {
        padding: 1rem 0.75rem 3rem 0.75rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        flex: none !important;
    }

    .card {
        padding: 1.25rem 0.85rem !important;
        margin-bottom: 1.25rem !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .card > h2 {
        font-size: 1.2rem !important;
    }

    /* Grids on mobile */
    .grid:not(.pdv-stats-grid) {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Horizontal scrollable tables inside admin cards */
    .card table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Responsive tabs */
    .pdv-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 0.5rem !important;
        padding-bottom: 4px !important;
    }

    .pdv-tab {
        white-space: nowrap !important;
        padding: 0.55rem 0.85rem !important;
        font-size: 0.85rem !important;
        flex-shrink: 0 !important;
    }
}