:root {
    --bg-color: #f0f9ff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-border: rgba(2, 132, 199, 0.15);
    --input-focus: rgba(14,165,233, 0.25);
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(2, 132, 199, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

.admin-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    background: white;
    z-index: 100;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1rem;
    border-bottom: 1px solid rgba(2, 132, 199, 0.05);
}

.logo img {
    width: 160px;
    max-width: 100%;
    object-fit: contain;
}

.logo h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

.menu {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-item:hover {
    background: rgba(2, 132, 199, 0.06);
    color: var(--primary);
    transform: translateX(4px);
}

.menu-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

/* Inventory workspace (Bling-like practical split) */
.inventory-workspace {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
    align-items: start;
}

.inventory-left-panel {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 0.85rem;
}

.inventory-main-panel {
    min-width: 0;
    display: grid;
    gap: 0.85rem;
}

.inventory-side-nav {
    display: grid;
    gap: 0.5rem;
}

.inventory-side-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: #fff;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.inventory-side-link:hover {
    border-color: rgba(2, 132, 199, 0.35);
    color: var(--text-main);
}

.inventory-side-link.active {
    color: var(--primary);
    border-color: rgba(2, 132, 199, 0.45);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12);
}

.inventory-panel-title {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 800;
}

.inventory-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.inventory-pagination .page-label {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.inventory-hero {
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(2,132,199,.11), rgba(14,116,144,.06));
    padding: 1rem 1.1rem;
    margin-bottom: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.inventory-hero .hero-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inventory-hero .hero-subtitle {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.inventory-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}

.inventory-kpi {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: #fff;
    padding: 0.75rem 0.85rem;
}

.inventory-kpi .kpi-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
}

.inventory-kpi .kpi-value {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

@media (max-width: 1120px) {
    .inventory-workspace {
        grid-template-columns: 1fr;
    }

    .inventory-left-panel {
        position: static;
    }
}

.menu-group {
    border: 1px solid rgba(2, 132, 199, 0.12);
    border-radius: 14px;
    background: #f8fbff;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.menu-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.72rem 0.9rem;
    cursor: pointer;
    font-weight: 700;
}

.menu-group-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.menu-group-title i {
    width: 18px;
    text-align: center;
    color: var(--primary);
}

.menu-group-chevron {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.menu-submenu {
    display: none;
    padding: 0 0.45rem 0.45rem;
    gap: 0.3rem;
    flex-direction: column;
    width: 100%;
}

.menu-group.open .menu-submenu {
    display: flex;
}

.menu-group.open .menu-group-chevron {
    transform: rotate(180deg);
}

.menu-submenu .menu-item {
    margin: 0;
    padding: 0.66rem 0.9rem;
    font-size: 0.93rem;
    min-height: 42px;
}

.sidebar-footer {
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(2, 132, 199, 0.05);
    background: #f8fafc;
}

.install-app-btn {
    width: 100%;
    border: 1px solid rgba(2, 132, 199, 0.2);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(14, 165, 233, 0.1));
    color: var(--text-main);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.install-app-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.16);
}

.admin-pwa-card {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    width: min(92vw, 360px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    padding: 0.95rem;
}

.admin-pwa-card .close-admin-pwa {
    position: absolute;
    top: 0.5rem;
    right: 0.55rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
}

.admin-pwa-card-content {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.admin-pwa-card-content i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--primary);
    background: rgba(2, 132, 199, 0.12);
    flex-shrink: 0;
}

.admin-pwa-card-copy strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-main);
}

.admin-pwa-card-copy p {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.admin-pwa-action {
    margin-left: auto;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 0.52rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-ios-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    padding: 1rem;
}

.admin-ios-modal-card {
    width: min(94vw, 430px);
    background: white;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.admin-ios-modal-head {
    padding: 1rem;
    border-bottom: 1px solid rgba(2, 132, 199, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-ios-modal-head h3 {
    font-size: 1rem;
    color: var(--text-main);
}

.admin-ios-modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

.admin-ios-steps {
    padding: 1rem;
    display: grid;
    gap: 0.7rem;
}

.admin-ios-step {
    border: 1px solid rgba(2, 132, 199, 0.14);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    background: rgba(248, 250, 252, 0.78);
}

.admin-ios-step strong {
    display: block;
    font-size: 0.86rem;
    margin-bottom: 0.15rem;
}

.admin-ios-step p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.admin-ios-modal-actions {
    padding: 0.85rem 1rem 1rem;
}

.logout-link {
    color: var(--danger) !important;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-decoration: none;
    font-weight: 700;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.user-profile i {
    font-size: 1.4rem;
    color: var(--text-muted);
}

.developed-by {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-muted);
}

.developed-by a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* Menu Ordering Styles */
.menu-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.menu-order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.menu-order-item i {
    width: 24px;
    text-align: center;
    color: var(--primary);
}

.menu-order-item span {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.menu-order-item input {
    width: 60px;
    padding: 0.4rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    text-align: center;
    font-weight: 700;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

/* Top navigation for store portal (desktop) */
.store-top-menu {
    min-height: 72px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 150;
    overflow: visible;
}

.store-top-menu-inner {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    overflow: visible;
}

.store-top-brand img {
    width: 122px;
    max-height: 48px;
    object-fit: contain;
}

.store-top-groups {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: visible;
    flex-wrap: wrap;
    padding: 0.2rem 0;
}

.store-top-group {
    position: relative;
    flex: 0 0 auto;
}

.store-top-group-btn {
    border: 1px solid rgba(2, 132, 199, 0.16);
    background: #f8fbff;
    color: var(--text-main);
    border-radius: 12px;
    padding: 0.52rem 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
}

.store-top-group.active .store-top-group-btn,
.store-top-group-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(2, 132, 199, 0.08);
}

.store-top-group-btn .fa-chevron-down {
    font-size: 0.75rem;
}

.store-top-submenu {
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    min-width: 240px;
    max-width: 360px;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    padding: 0.5rem;
    z-index: 200;
}

.store-top-group:hover .store-top-submenu,
.store-top-group.open .store-top-submenu {
    display: flex;
}

.store-top-submenu-link {
    text-decoration: none;
    color: var(--text-main);
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    font-weight: 600;
}

.store-top-submenu-link:hover,
.store-top-submenu-link.active {
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary);
}

.store-top-direct-link {
    text-decoration: none;
    border: 1px solid rgba(2, 132, 199, 0.16);
    background: #f8fbff;
    color: var(--text-main);
    border-radius: 12px;
    padding: 0.52rem 0.8rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.store-top-direct-link:hover,
.store-top-direct-link.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(2, 132, 199, 0.08);
}

.store-top-user {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
}

.store-top-user-toggle {
    border: 1px solid rgba(2, 132, 199, 0.16);
    background: #f8fbff;
    color: var(--text-main);
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.store-top-user-toggle:hover,
.store-top-user.open .store-top-user-toggle {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(2, 132, 199, 0.08);
}

.store-top-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 250px;
    display: none;
    flex-direction: column;
    gap: 0.55rem;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    padding: 0.85rem;
    z-index: 220;
}

.store-top-user.open .store-top-user-dropdown {
    display: flex;
}

.store-top-logout-btn {
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    background: white;
    border-radius: 10px;
    padding: 0.52rem 0.7rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.store-top-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

body.use-top-store-menu .admin-container {
    display: block;
}

body.use-top-store-menu .main-content {
    height: calc(100vh - 90px);
    padding: 1.25rem 1.5rem;
}

body.use-top-store-menu .sidebar {
    display: none;
}

body.use-top-store-menu .dashboard-section {
    max-width: 100%;
    width: 100%;
    margin: 0;
}

.dashboard-section {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

.top-header {
    margin-bottom: 3rem;
}

.top-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 700px;
}

/* Glass Card & Forms */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px -5px rgba(2, 132, 199, 0.08);
}

.admin-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.admin-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-input-wrapper i {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.admin-input,
.validation-input-group input,
.validation-input-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    background: white;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s;
    outline: none;
}

.admin-input-wrapper i+.admin-input {
    padding-left: 3rem;
}

.admin-input:focus,
.validation-input-group input:focus,
.validation-input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--input-focus);
    background: white;
}

.admin-input::placeholder {
    color: #cbd5e1;
}

/* Layout Classes */
.centered-container {
    max-width: 650px;
    margin: 0 auto;
}

.centered-container.wide-page-container {
    max-width: 1240px;
    width: 100%;
}

.grid-container {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Componentes de Tabela */
.admin-table-wrapper {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.sales-orders-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
}

.sales-orders-table-wrapper .admin-table {
    min-width: 1280px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    border-bottom: 2px solid var(--glass-border);
}

.admin-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(2, 132, 199, 0.04);
    font-size: 0.95rem;
    vertical-align: middle;
}

.td-center {
    text-align: center !important;
}

.admin-table tr:hover td {
    background: rgba(2, 132, 199, 0.01);
}

/* Buttons */
.primary-btn {
    padding: 1.1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.3);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(2, 132, 199, 0.4);
}

.secondary-btn {
    padding: 0.8rem 1.5rem;
    background: white;
    color: var(--text-muted);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(2, 132, 199, 0.02);
}

/* Badges & Stats */
.stat-card {
    position: relative;
    padding: 2.25rem;
    overflow: hidden;
}

.stat-card.highlight {
    border-top: 5px solid var(--primary);
}

.stat-card h3 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.stat-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card i {
    position: absolute;
    right: -1rem;
    bottom: -1rem;
    font-size: 6rem;
    opacity: 0.05;
    color: var(--primary);
    transform: rotate(-15deg);
}

.balance-badge {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.9rem;
}

.crm-summary-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(2, 132, 199, 0.08);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.05);
}

.crm-summary-card span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.crm-summary-card strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.15rem;
    color: var(--text-main);
    font-weight: 800;
}

.crm-summary-card small {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-view {
    padding: 0.65rem 1.25rem;
    background: white;
    color: var(--primary);
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.btn-delete {
    padding: 0.65rem;
    background: #fff1f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.badge {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none !important;
}

.badge.success {
    background: #d1fae5;
    color: #065f46;
}

.badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.info {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

/* Modal & Transitions */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

/* App Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    background: white;
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--glass-border);
    z-index: 20;
}

.app-footer a {
    color: inherit;
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--primary);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse-anim {
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.3);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 30px -5px rgba(2, 132, 199, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 10px 20px -5px rgba(2, 132, 199, 0.3);
    }
}

/* Search Wrapper Utility */
.search-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 300px;
}

.customer-mobile-list {
    display: grid;
    gap: 0.85rem;
}

.customer-mobile-card {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.9rem;
}

.customer-mobile-head {
    display: grid;
    gap: 0.1rem;
    margin-bottom: 0.6rem;
}

.customer-mobile-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.customer-table-identity {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.customer-avatar-sm {
    width: 34px;
    height: 34px;
}

.customer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.customer-mobile-head strong {
    font-size: 0.98rem;
    color: var(--text-main);
}

.customer-mobile-head small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.customer-mobile-lines {
    display: grid;
    gap: 0.28rem;
}

.customer-mobile-lines p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-main);
}

.customer-mobile-lines span {
    color: var(--text-muted);
    font-weight: 700;
}

.customer-mobile-actions {
    margin-top: 0.7rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.customer-mobile-actions button {
    border: 1px solid var(--glass-border);
    background: #fff;
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.45rem 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.customer-mobile-actions .btn-delete-customer {
    border-color: #fecaca;
    color: #b91c1c;
}

.mobile-record-list {
    display: grid;
    gap: 0.8rem;
}

.mobile-record-card {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.85rem 0.9rem;
}

.mobile-record-head {
    display: grid;
    gap: 0.1rem;
    margin-bottom: 0.5rem;
}

.mobile-record-head strong {
    font-size: 0.95rem;
    color: var(--text-main);
}

.mobile-record-head small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-record-card p {
    margin: 0.18rem 0;
    font-size: 0.82rem;
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.mobile-record-card p span {
    color: var(--text-muted);
    font-weight: 700;
}

.mobile-record-card .btn-view,
.mobile-record-card .btn-delete {
    margin-top: 0.55rem;
    width: 100%;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar .logo h2,
    .sidebar .developed-by,
    .user-profile span,
    .install-app-btn span {
        display: none;
    }

    .menu-item span {
        display: none;
    }

    .menu-item {
        justify-content: center;
        padding: 1rem;
    }

    .install-app-btn {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    body.use-top-store-menu .store-top-menu {
        display: none;
    }

    body.use-top-store-menu .sidebar {
        display: flex;
    }

    body.use-top-store-menu .main-content {
        height: auto;
    }

    .admin-container {
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        max-height: 48dvh;
        overflow: hidden;
    }

    .sidebar .logo {
        padding: 1rem;
        flex-direction: column;
        justify-content: center;
    }

    .menu {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0.75rem;
        max-height: 34dvh;
    }

    .menu-item {
        padding: 0.75rem;
        justify-content: flex-start;
    }

    .sidebar-footer {
        display: none;
    }

    body.show-mobile-sidebar-footer .sidebar-footer {
        display: block;
    }

    .main-content {
        padding: 1rem;
        overflow-x: hidden;
    }

    .top-header h1 {
        font-size: 1.45rem;
    }

    .glass-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .admin-table-wrapper {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--glass-border);
        background: white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
        border-radius: 12px;
    }

    .admin-table {
        min-width: 740px;
    }

    .dashboard-section {
        max-width: 100%;
    }

    .top-header {
        margin-bottom: 1.25rem;
    }

    .subtitle {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .search-wrapper {
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .search-input-group {
        min-width: 0;
        width: 100%;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .primary-btn,
    .secondary-btn,
    .btn-view {
        min-height: 42px;
    }

    .modal {
        padding: 0.75rem;
    }

    .modal-content {
        width: 100%;
        max-height: calc(100dvh - 1.5rem);
        border-radius: 14px;
    }

    .admin-form-group {
        margin-bottom: 1rem;
    }

    .admin-input,
    .validation-input-group input,
    .validation-input-group select {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }

    .admin-input-wrapper i + .admin-input {
        padding-left: 2.7rem;
    }

    .admin-pwa-card {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        bottom: 0.75rem;
    }

    .admin-pwa-card-content {
        gap: 0.55rem;
    }

    .admin-pwa-card-copy p {
        font-size: 0.75rem;
    }
}
