/* css/styles.css */
/* Suggested Shift Highlight */
.suggested-shift {
    position: relative;
    border: 2px solid var(--primary-color) !important;
    animation: pulseSuggested 2s infinite;
}
.suggested-shift::after {
    content: "REKOMENDASI";
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    z-index: 10;
}
@keyframes pulseSuggested {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

:root {
    /* Light Mode Palette */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.02);
    --item-bg: #ffffff;
    --border-color: #e2e8f0;
}

body.dark-mode {
    /* Dark Mode Palette */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --success-color: #34d399;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.2);
    --item-bg: #1e293b;
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    overflow: hidden; /* Desktop app feel */
    -webkit-tap-highlight-color: transparent; /* Fix blue/gray box on tap */
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.glass-input {
    background: rgba(0,0,0,0.03) !important;
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
body.dark-mode .glass-input {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid var(--glass-border);
}

/* Base Utility Classes */
.text-danger { color: var(--danger-color) !important; }
.text-success { color: var(--success-color) !important; }
.show-on-mobile { display: none !important; }
.hide-for-manager { display: none !important; }
body.role-manager .hide-for-manager, body.role-manager .role-admin-only { display: none !important; }
body.role-admin .hide-for-manager, body.role-admin .role-admin-only { display: initial !important; }


/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr 360px;
    height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* Sidebar */
.sidebar { border-radius: 24px; display: flex; flex-direction: column; padding: 20px 16px; min-height: 0; }
.logo-area { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; color: var(--primary-color); }
.logo-area i { font-size: 32px; }
.logo-area h2 { font-size: 22px; font-weight: 700; }

.nav-section-title {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    margin: 16px 16px 8px;
    opacity: 0.6;
}

.nav-menu { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; overflow-y: auto; padding-right: 4px; }
.nav-menu::-webkit-scrollbar { width: 4px; }
.nav-menu::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    text-decoration: none; color: var(--text-muted); border-radius: 12px;
    font-weight: 500; font-size: 14px; transition: all 0.2s ease;
    cursor: pointer;
    touch-action: manipulation;
}
.nav-item i { font-size: 18px; }
.nav-item:hover { background-color: var(--bg-primary); color: var(--text-main); }
.nav-item:active { transform: scale(0.96); opacity: 0.8; }
.nav-item.active { background-color: var(--primary-color); color: white; box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4); }

.sidebar-bottom { display: flex; flex-direction: column; gap: 4px; }
.sidebar-bottom button, .sidebar-bottom div {
    display: flex; align-items: center; gap: 12px; padding: 16px;
    border-radius: 14px; cursor: pointer; font-weight: 500; font-size: 15px;
    border: none; background: transparent; color: var(--text-muted); transition: all 0.2s;
}
.sidebar-bottom i { font-size: 20px; }
.sidebar-bottom button:hover, .sidebar-bottom div:hover { background-color: var(--bg-primary); color: var(--text-main); }

/* Kasir Mode Badge */
.kasir-mode-badge { color: var(--text-muted) !important; }
.kasir-mode-badge.kasir-active { 
    color: var(--success-color) !important; 
    background: rgba(16,185,129,0.15) !important;
}
body.kasir-locked .kasir-mode-badge {
    color: var(--warning-color) !important;
    background: rgba(245,158,11,0.12) !important;
    animation: pulseWarn 2s infinite;
}
@keyframes pulseWarn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Kasir Locked — hide admin & settings buttons */
body.kasir-locked #settingsBtn,
body.kasir-locked #adminBtn { display: none !important; }

/* Main Content */
.main-content { display: flex; flex-direction: column; gap: 24px; overflow: hidden; }

.top-bar { display: flex; justify-content: space-between; align-items: center; height: 64px; min-height: 64px; }
.search-bar { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-radius: 20px; height: 56px; width: 360px; }
.search-bar input { border: none; background: transparent; outline: none; color: var(--text-main); width: 100%; font-size: 16px; }
.search-bar i { color: var(--text-muted); font-size: 22px; }

.status-indicators { display: flex; gap: 16px; }
.indicator { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--glass-bg); border: 1px solid var(--border-color); }
.indicator.online { color: var(--success-color); }
.indicator.offline { color: var(--danger-color); }
.indicator.connected { color: var(--success-color); }
.indicator.disconnected { color: var(--text-muted); }

.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px; overflow-y: auto; padding: 10px 12px 24px 10px;
}
.products-grid::-webkit-scrollbar { width: 8px; }
.products-grid::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

/* Product Card */
.product-card {
    background: var(--item-bg); border-radius: 20px; padding: 16px; cursor: pointer;
    box-shadow: var(--shadow-soft); border: 1px solid var(--border-color);
    display: flex; flex-direction: column; gap: 16px; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; user-select: none;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(0,0,0,0.1); border-color: var(--primary-color); }
.product-img-placeholder {
    width: 100%; height: 140px; border-radius: 16px; background-color: var(--bg-primary);
    display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--text-muted);
    overflow: hidden;
}
.product-real-img { width: 100%; height: 100%; object-fit: cover; }
.product-info h4 { font-size: 16px; margin-bottom: 6px; }
.product-info p { color: var(--primary-color); font-weight: 700; font-size: 16px; }
.product-stock { font-size: 13px; color: var(--text-muted); margin-top: 4px; display: block; }

/* Cart Sidebar */
.cart-sidebar { border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; }

.cart-header {
    padding: 28px 24px 20px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.cart-header h3 { font-size: 18px; }
.order-id { font-size: 12px; background: var(--text-main); color: var(--bg-primary); padding: 6px 10px; border-radius: 8px; font-weight: 600; }

.cart-items { flex-grow: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.cart-items::-webkit-scrollbar { width: 6px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }

.empty-cart-message { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); text-align: center; }
.empty-cart-message i { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }

/* Cart Item */
.cart-item { background: var(--bg-primary); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border-color); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.item-top { display: flex; justify-content: space-between; align-items: flex-start; }
.item-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.item-price { color: var(--text-muted); font-size: 13px; }
.item-remove { background: transparent; border: none; color: var(--danger-color); cursor: pointer; font-size: 18px; padding: 4px; }
.item-controls { display: flex; justify-content: space-between; align-items: center; }
.qty-controls { display: flex; align-items: center; gap: 16px; background: var(--item-bg); border-radius: 10px; padding: 6px; border: 1px solid var(--border-color); }
.qty-btn { width: 32px; height: 32px; border: none; border-radius: 8px; background: var(--bg-primary); color: var(--text-main); cursor: pointer; font-weight: 700; font-size: 16px; transition: all 0.2s; }
.qty-btn:hover { background: var(--primary-color); color: white; }
.item-total { font-weight: 700; color: var(--primary-color); }

.cart-summary { padding: 24px; background: var(--item-bg); border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 16px; }
.summary-row { display: flex; justify-content: space-between; font-size: 15px; color: var(--text-muted); font-weight: 500; }
.total-row { color: var(--text-main); font-size: 20px; font-weight: 800; margin-top: 8px; padding-top: 16px; border-top: 2px dashed var(--border-color); }
.action-buttons { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 20px; }

/* Smart Cart Animation */
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.pulse-hover:hover:not(:disabled) { animation: pop 0.4s ease; }
.pulse-active { animation: pop 0.3s ease; }

.small-icon-btn { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.small-icon-btn:hover { background: var(--primary-color); color: white; }

/* Base Buttons */
.btn { padding: 16px; border-radius: 14px; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; border: none; transition: all 0.2s; }
.btn i { font-size: 20px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4); }

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4); }

.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4); }

.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover:not(:disabled) { background: var(--bg-primary); }

.btn-large { padding: 20px; font-size: 18px; }

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center;
    z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

/* Selection overlay should be below other modals */
#roleSelectionOverlay {
    z-index: 5000;
}

#loadingOverlay {
    z-index: 20000;
}

.modal {
    width: 600px; max-width: 90%; border-radius: 28px; display: flex; flex-direction: column;
    transform: translateY(30px) scale(0.95); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header { padding: 28px 32px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 22px; }
.close-modal { background: transparent; border: none; font-size: 28px; color: var(--text-muted); cursor: pointer; }
.close-modal:hover { color: var(--danger-color); }

.modal-body { padding: 32px; display: flex; flex-direction: column; gap: 24px; max-height: 75vh; overflow-y: auto; }
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.modal-footer { padding: 20px 32px 32px; border-top: 1px solid var(--border-color); }

/* Payment Details */
.payment-amount { text-align: center; background: var(--bg-primary); padding: 24px; border-radius: 20px; }
.payment-amount span { color: var(--text-muted); font-size: 15px; font-weight: 500; }
.payment-amount h1 { color: var(--primary-color); font-size: 40px; margin-top: 8px; }

.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.payment-method-btn { padding: 20px; border-radius: 16px; border: 2px solid var(--border-color); background: transparent; color: var(--text-muted); font-weight: 600; font-size: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; transition: all 0.2s; }
.payment-method-btn i { font-size: 28px; }
.payment-method-btn.active { border-color: var(--primary-color); background: rgba(59, 130, 246, 0.1); color: var(--primary-color); }

.payment-details { display: none; margin-top: 8px; animation: fadeIn 0.3s forwards; }
.payment-details.active { display: block; }

.input-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.input-group label { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.amount-input-wrapper { display: flex; align-items: center; padding: 0 20px; border-radius: 16px; height: 64px; }
.amount-input-wrapper span { font-weight: 600; color: var(--text-muted); margin-right: 12px; font-size: 18px; }
.amount-input-wrapper input { border: none; background: transparent; outline: none; color: var(--text-main); font-size: 24px; font-weight: 700; width: 100%; }

.quick-cash { display: flex; gap: 12px; margin-bottom: 24px; }
.quick-cash-btn { flex: 1; padding: 14px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-main); cursor: pointer; font-weight: 600; font-size: 15px; }
.quick-cash-btn:hover { background: var(--border-color); }

.change-calc { display: flex; justify-content: space-between; align-items: center; padding: 20px; background: rgba(16, 185, 129, 0.1); border-radius: 16px; border: 1px dashed rgba(16, 185, 129, 0.4); }
.change-calc span { color: var(--text-main); font-weight: 600; font-size: 16px; }
.change-calc h3 { color: var(--success-color); font-size: 28px; }

/* HPP Summary Box (BOM Tab) */
.hpp-summary-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: #0f172a; /* Deep Slate - Darker than primary */
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
    border-left: 6px solid var(--primary-color);
}
.hpp-summary-box span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}
.hpp-summary-box h3 {
    font-size: 30px;
    color: var(--primary-color);
    font-weight: 800;
}

/* QRIS details */
.qris-container { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.qris-img { width: 240px; height: 240px; border-radius: 20px; object-fit: contain; background: white; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.qris-container p { color: var(--text-muted); font-size: 15px; }
.qris-status { display: flex; align-items: center; gap: 10px; color: var(--warning-color); font-weight: 600; background: rgba(245, 158, 11, 0.1); padding: 12px 24px; border-radius: 12px; }

/* Discount Type Buttons */
.discount-type-btn { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-muted); font-weight: 600; cursor: pointer; }
.discount-type-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.spin { animation: spin 2s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Settings Tabs */
.settings-tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; }
.tab-btn { padding: 16px 20px; background: transparent; border: none; border-bottom: 3px solid transparent; color: var(--text-muted); font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.2s; }
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s; }

input.glass-input, select.glass-input { 
    padding: 16px 20px; 
    border-radius: 14px; 
    font-size: 15px; 
    outline: none;
    width: 100%;
}
select.glass-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    cursor: pointer;
}

.printer-management { display: flex; flex-direction: column; gap: 20px; }
.printer-status-panel { background: var(--bg-primary); padding: 20px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.printer-status-panel strong { color: var(--primary-color); }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container { grid-template-columns: 80px 1fr 340px; } /* Tablet view layout */
    .hide-on-tablet { display: none !important; }
    .sidebar { padding: 24px 10px; align-items: center; }
    .logo-area { margin-bottom: 30px; }
    .nav-item { justify-content: center; padding: 14px 0; border-radius: 12px; width: 100%; }
    .nav-item i { font-size: 26px; }
    .sidebar-bottom button, .sidebar-bottom div { padding: 14px 0; justify-content: center; width: 100%; }
    .search-bar { width: 200px; }
}

@media (max-width: 768px) {
    .app-container { display: flex; flex-direction: column; height: 100vh; padding: 10px; padding-bottom: 80px; }
    body.dark-mode .app-container { background: #0f172a; }
    .sidebar {
        position: fixed; bottom: 0; left: 0; right: 0; height: 70px;
        flex-direction: row; border-radius: 20px 20px 0 0; z-index: 100;
        padding: 0 10px; justify-content: space-between;
    }
    .hide-on-mobile { display: none !important; }
    .show-on-mobile { display: flex !important; }
    .nav-menu { flex-direction: row; flex-grow: 1; justify-content: space-around; }
    .nav-item { padding: 10px; border-radius: 16px; width: auto; }
    
    /* Cart Sidebar Overlapping Modal */
    .cart-sidebar {
        position: fixed; top: 0; right: -100%; bottom: 0; width: 100%; max-width: 100%;
        border-radius: 0; z-index: 200; transition: right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        padding-bottom: 20px; /* spacing */
    }
    .cart-sidebar.open { right: 0; }
    
    .search-bar { width: 100%; }
    .top-bar { margin-bottom: 10px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    
    .mobile-nav-icons { align-items: center; gap: 16px; margin-right: 15px; display: flex; }
    .nav-icon-btn { background: transparent; border: none; color: var(--text-muted); font-size: 32px; position: relative; cursor: pointer; }
    .nav-icon-btn:hover { color: var(--primary-color); }
    .badge {
        position: absolute; top: -5px; right: -5px; background: var(--danger-color); color: white;
        font-size: 11px; font-weight: bold; width: 18px; height: 18px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center; border: 2px solid var(--item-bg);
    }
}

/* Fix for Select Options Contrast in Dark Mode */
select option {
    background: var(--bg-primary);
    color: var(--text-main);
}


.sync-btn:active i {
    animation: bounceDown 0.5s ease;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}


/* Custom Toast Notification */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.toast {
    background: var(--bg-primary);
    color: var(--text-main);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
}
.toast.success { border-left-color: var(--success-color); }
.toast.danger { border-left-color: var(--danger-color); }
.toast.info { border-left-color: var(--primary-color); }

@keyframes slideInToast {
    to { transform: translateX(0); }
}
@keyframes slideOutToast {
    to { transform: translateX(150%); opacity: 0; }
}

/* Role Selection UI (Entrance) */
.role-selection-container {
    width: 900px;
    max-width: 95%;
    padding: 60px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(32px);
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
    text-align: center;
    animation: fadeInScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9) translateY(40px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.role-selection-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-selection-header p {
    color: var(--text-muted);
    font-size: 18px;
    margin-bottom: 50px;
}

.role-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.role-card {
    background: var(--bg-secondary);
    padding: 40px 30px;
    border-radius: 32px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.role-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
    border-color: var(--primary-color);
}

.role-icon {
    width: 100px;
    height: 100px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 10px;
}

.role-card h3 {
    font-size: 22px;
    font-weight: 700;
}

.role-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.role-badge {
    position: absolute;
    top: 20px;
    right: -30px;
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 40px;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.role-card:nth-child(2) .role-badge { background: var(--warning-color); }
.role-card:nth-child(3) .role-badge { background: var(--success-color); }

@media (max-width: 768px) {
    .role-selection-container { padding: 40px 20px; border-radius: 0; height: 100%; width: 100%; max-width: 100%; display: flex; flex-direction: column; justify-content: center; }
    .role-cards-grid { grid-template-columns: 1fr; gap: 20px; }
    .role-card { padding: 25px; flex-direction: row; text-align: left; }
    .role-icon { width: 60px; height: 60px; font-size: 28px; margin-bottom: 0; }
    .role-card p { display: none; }
    .role-selection-header h1 { font-size: 28px; }
    .role-selection-header p { font-size: 15px; margin-bottom: 30px; }
}

/* Sidebar Switch Role Button */
.switch-role-btn {
    margin-top: 10px;
    color: var(--danger-color) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}
.switch-role-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.role-icon-admin {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color)) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
