:root {
    /* Adminty Theme Colors */
    --adminty-bg: #f4f7fa;
    --adminty-sidebar: #404E67;
    --adminty-sidebar-active: #3b485f;
    --adminty-header: #ffffff;

    /* Card Colors */
    --card-teal: #2ED8B6;
    /* Views */
    --card-orange: #FFB64D;
    /* Enquiries */
    --card-pink: #FF5370;
    /* Tasks/Reviews */
    --card-cyan: #4099ff;
    /* Rating */

    /* Text Colors */
    --text-primary: #353c4e;
    --text-secondary: #888888;
    --text-muted: #919aa3;

    /* Base Tokens */
    --color-white: #FFFFFF;
    --color-border: #e9ecef;

    /* Typography */
    --font-family-base: "Open Sans", sans-serif;
    --font-size-base: 14px;

    /* Spacing */
    --space-16: 1rem;
    --space-24: 1.5rem;

    /* Shadows */
    --shadow-card: 0 1px 20px 0 rgba(69, 90, 100, 0.08);
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    background-color: var(--adminty-bg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hidden {
    display: none !important;
}

/* --- LAYOUT --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.main-nav {
    width: 264px;
    background-color: var(--adminty-sidebar);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.nav-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background-color: rgba(0, 0, 0, 0.1);
    font-size: 20px;
    font-weight: 700;
}

.nav-links {
    padding: 10px 0;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #b7c0cd;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background-color: var(--adminty-sidebar-active);
    border-left-color: var(--card-cyan);
}

.nav-links a svg {
    width: 18px;
    height: 18px;
    margin-right: 15px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 264px;
    padding: 20px;
    width: calc(100% - 264px);
    min-height: 100vh;
    background-color: var(--adminty-bg);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

.app-header {
    background: var(--adminty-header);
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.05);
    margin: -20px -20px 20px -20px;
    /* Stretch full width */
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile Toggle */
#menu-btn,
#mb-menu-btn,
#hub-menu-btn,
#inbox-menu-btn {
    display: flex;
    color: var(--card-teal);
    background: #ffffff;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

#menu-btn:hover,
#mb-menu-btn:hover,
#hub-menu-btn:hover,
#inbox-menu-btn:hover {
    background: #f4f7fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#menu-btn:active,
#mb-menu-btn:active,
#hub-menu-btn:active,
#inbox-menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(46, 216, 182, 0.3);
}

#menu-btn svg,
#mb-menu-btn svg,
#hub-menu-btn svg,
#inbox-menu-btn svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* --- DASHBOARD WIDGETS (Adminty Style) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card-counter {
    box-shadow: var(--shadow-card);
    background-color: #fff;
    padding: 20px 10px;
    border-radius: 5px;
    transition: .3s linear all;
    position: relative;
    overflow: hidden;
    color: #fff;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-counter.primary {
    background-color: var(--card-cyan);
}

.card-counter.success {
    background-color: var(--card-teal);
}

.card-counter.danger {
    background-color: var(--card-pink);
}

.card-counter.warning {
    background-color: var(--card-orange);
}

.card-counter i,
.card-counter svg {
    font-size: 5em;
    opacity: 0.2;
    position: absolute;
    right: -10px;
    top: -10px;
    width: 80px;
    height: 80px;
    color: #fff;
}

.card-counter .count-numbers {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 5px;
    z-index: 1;
}

.card-counter .count-name {
    font-size: 16px;
    text-transform: capitalize;
    opacity: 0.9;
    z-index: 1;
    font-weight: 400;
}

.card-counter .update-text {
    font-size: 11px;
    margin-top: 10px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- CONTENT CARDS --- */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 5px;
    box-shadow: var(--shadow-card);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    /* Prevent wrapping but allow slight squish */
}

.card-header h5 {
    color: var(--text-primary);
    font-size: 15px;
    /* Slightly smaller to fit */
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-body {
    padding: 20px 25px;
    overflow: hidden;
    /* Prevent content overflow */
}

.card-body canvas {
    max-width: 100% !important;
    height: auto !important;
}

/* Profile Strength Gauge (Simulated) */
.profile-strength-wrapper {
    text-align: center;
    padding: 20px;
}

.gauge-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 10px solid #f2f2f2;
    border-top-color: var(--card-orange);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--card-orange);
}

/* Recent Activity List */
.activity-feed {
    list-style: none;
}

.activity-feed li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.activity-feed li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.bg-green {
    background: var(--card-teal);
}

.bg-blue {
    background: var(--card-cyan);
}

.bg-orange {
    background: var(--card-orange);
}

.feed-content h6 {
    font-size: 14px;
    margin-bottom: 5px;
}

.feed-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.feed-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: linear-gradient(to right, #4099ff, #73b4ff);
    /* Vibrant Blue Gradient */
    color: #fff;
    box-shadow: 0 4px 12px rgba(64, 153, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(64, 153, 255, 0.4);
    opacity: 0.9;
}

.btn-secondary {
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    /* Nice Blue/Cyan Gradient */
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5);
    background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
    opacity: 0.9;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 5px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    background: var(--adminty-bg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    padding: 12px 20px;
    margin-top: 10px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--card-teal);
}

.toast-error {
    background: var(--card-pink);
}

/* Responsive */
@media (max-width: 991px) {
    .main-nav {
        transform: translateX(-100%);
    }

    .main-nav.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    #menu-btn {
        display: block;
    }
}

@media (max-width: 576px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Helper Classes */
.text-c-green {
    color: var(--card-teal);
}

.text-c-yellow {
    color: var(--card-orange);
}

.text-c-pink {
    color: var(--card-pink);
}

.text-c-blue {
    color: var(--card-cyan);
}

.m-b-20 {
    margin-bottom: 20px;
}

/* --- NEW UPLOAD BUTTONS --- */
.btn-upload-profile {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(to right, #2ED8B6, #59e0c5);
    /* Green/Teal Gradient */
    color: white;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(254, 93, 112, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-upload-profile:hover {
    transform: scale(1.1) rotate(90deg);
}

.gallery-add-btn {
    width: 100%;
    height: 100px;
    background: rgba(46, 216, 182, 0.1);
    /* Very light Teal */
    border: 2px dashed #2ED8B6;
    /* Vibrant Teal */
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2ED8B6;
}

.gallery-add-btn:hover {
    background: rgba(46, 216, 182, 0.2);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 216, 182, 0.3);
}

.gallery-add-text {
    font-size: 11px;
    font-weight: 700;
    margin-top: 5px;
    text-transform: uppercase;
}

/* --- DASHBOARD WIDGETS STYLES --- */

/* Message & Update Lists */
.widget-list-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: background 0.2s;
    cursor: pointer;
}

.widget-list-item:hover {
    background: #f9fafb;
}

.widget-list-item:last-child {
    border-bottom: none;
}

/* Avatars */
.widget-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.widget-icon-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-teal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Content */
.widget-content {
    flex-grow: 1;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.widget-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.widget-snippet {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* B2B Cards inner styling */
.collab-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
}

.collab-item:last-child {
    border-bottom: none;
}

.collab-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.collab-badge {
    background: #e3f2fd;
    color: #1e88e5;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.collab-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    border: none;
}

.btn-accept {
    background: var(--card-green);
    color: white;
}

.btn-decline {
    background: #fee2e2;
    color: #ef4444;
}

/* Hub Tabs */
.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--card-teal);
    border-bottom-color: var(--card-teal);
}

.hub-msg-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.hub-msg-item:last-child {
    border-bottom: none;
}

.hub-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
    flex-shrink: 0;
}

/* --- NOTIFICATION BELL ENHANCEMENT --- */
.notification-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    color: var(--card-teal);
    background-color: rgba(46, 216, 182, 0.1);
}

.notification-bell svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.notification-bell:hover svg {
    transform: rotate(15deg);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 10px;
    height: 10px;
    background-color: #ff5252;
    /* Bright Red */
    border-radius: 50%;
    border: 2px solid #fff;
    font-size: 0;
    /* Hide count text to show just a dot */
    display: none;
    /* Controlled by JS */
    box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    animation: pulse-red 2s infinite;
    z-index: 10;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 82, 82, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0);
    }
}


/* --- NOTIFICATION DROPDOWN STYLES --- */
.notification-dropdown {
    position: fixed;
    top: 75px;
    right: 20px;
    /* Adjusted to be closer to edge, usually bell is right-aligned */
    width: 320px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    /* Higher than header */
    border: 1px solid #e0e0e0;
}

@media (min-width: 992px) {
    .notification-dropdown {
        right: 80px;
        /* More inward on desktop to align with bell usually */
    }
}

.notification-dropdown.hidden {
    display: none;
}

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

.notification-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: #e3fcf7;
    /* Light teal tint */
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 14px;
}

.notification-content {
    flex: 1;
}

.notification-content h6 {
    margin: 0 0 2px;
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.notification-content p {
    margin: 0 0 2px;
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.notification-time {
    font-size: 10px;
    color: #999;
}

/* Hide menu buttons on desktop by default when sidebar is open */
@media (min-width: 992px) {

    #menu-btn,
    #mb-menu-btn,
    #hub-menu-btn,
    #inbox-menu-btn {
        display: none;
    }
}

/* --- DESKTOP SIDEBAR TOGGLE --- */
@media (min-width: 992px) {
    .main-nav.sidebar-closed {
        transform: translateX(-100%);
    }

    .main-content.sidebar-closed {
        margin-left: 0;
        width: 100%;
    }

    /* Show menu button when sidebar is closed so user can re-open */
    body.menu-closed #menu-btn,
    body.menu-closed #mb-menu-btn,
    body.menu-closed #hub-menu-btn,
    body.menu-closed #inbox-menu-btn {
        display: flex !important;
        margin-right: 15px;
        background: #ffffff;
        color: var(--card-teal);
        border: 1px solid #eee;
    }
}

/* --- FULLSCREEN CARD OPTIMIZATION --- */
.card.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 10px !important;
    border-radius: 0 !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    /* Allow scroll if needed on tiny screens */
}

.card.fullscreen .card-header {
    padding: 10px 15px !important;
    border-bottom: 1px solid #eee !important;
    background: #fff !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10001 !important;
}

.card.fullscreen .card-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 15px !important;
    background: #fff !important;
}

.card.fullscreen canvas {
    max-height: 70vh !important;
    width: 100% !important;
}

/* Minimize/Exit button visibility */
.card .minimize-btn {
    display: none;
    /* Hidden normally */
}

.card.fullscreen .minimize-btn {
    display: flex !important;
}

.card.fullscreen .fullscreen-btn {
    display: none !important;
    /* Hide expand button in fullscreen */
}

/* Hide other content when fullscreen to prevent scroll issues */
body.has-fullscreen {
    overflow: hidden !important;
}

@media (max-width: 576px) {
    .card.fullscreen {
        padding: 5px !important;
    }

    .card.fullscreen .card-body {
        padding: 5px !important;
    }
}

/* --- RUN ADS BUTTON --- */
.run-ads-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0fdf4;
    /* Light Green */
    color: #16a34a;
    /* Green text */
    border: 1px solid #dcfce7;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.run-ads-btn:hover {
    background: #dcfce7;
    transform: translateY(-1px);
}

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

@media (max-width: 768px) {
    .run-ads-btn {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
        margin-right: 8px;
    }
}


/* --- RUN AD MODAL --- */
.run-ad-modal {
    max-width: 500px !important;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fcfcfc;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: #2ed8b6;
    background: rgba(46, 216, 182, 0.05);
}

.poster-preview {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.poster-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.run-ad-btn-fill {
    background: linear-gradient(135deg, #00b09b, #96c93d) !important;
    border: none !important;
    font-weight: 700 !important;
}