/* =========================================================
   KEFITERIA B2B ENTERPRISE CATERING & SAAS PLATFORM STYLESHEET
   Design System: Warm Artisanal Gold & High-Tech Glassmorphism
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Dark Theme Palette (Default) */
    --bg-primary: #0c0a09;
    --bg-secondary: #1c1917;
    --bg-card: rgba(28, 25, 23, 0.75);
    --bg-glass: rgba(44, 40, 37, 0.55);
    --border-color: rgba(245, 158, 11, 0.18);
    --border-hover: rgba(245, 158, 11, 0.45);
    
    --text-primary: #f5f5f4;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;

    --gold-primary: #f59e0b;
    --gold-hover: #d97706;
    --gold-light: rgba(245, 158, 11, 0.15);
    --gold-glow: 0 0 25px rgba(245, 158, 11, 0.35);

    --accent-red: #ef4444;
    --accent-green: #10b981;
    --accent-blue: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-main: 0 12px 35px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(245, 245, 244, 0.75);
    --border-color: rgba(217, 119, 6, 0.25);
    --border-hover: rgba(217, 119, 6, 0.55);

    --text-primary: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #78716c;

    --gold-primary: #d97706;
    --gold-hover: #b45309;
    --gold-light: rgba(217, 119, 6, 0.12);
    --shadow-main: 0 12px 35px rgba(0, 0, 0, 0.08);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

a {
    color: var(--gold-primary);
    text-decoration: none;
    transition: var(--transition);
}

/* Typography Utilities */
.text-gold { color: var(--gold-primary) !important; }
.text-success { color: var(--accent-green) !important; }
.text-danger { color: var(--accent-red) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700; }
.w-100 { width: 100%; }

/* Glassmorphism Cards */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-main);
    transition: var(--transition);
}

.card-glass:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-hover));
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: var(--gold-glow);
}

.btn-gold-ghost {
    background: var(--gold-light);
    color: var(--gold-primary);
    border: 1px solid var(--border-color);
}

.btn-gold-ghost:hover {
    background: var(--gold-primary);
    color: #fff;
}

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

.btn-outline:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.btn-sm { padding: 7px 15px; font-size: 0.85rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }

/* Main Header & Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(12, 10, 9, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid var(--gold-primary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
    filter: brightness(1.25) contrast(1.1);
    transition: var(--transition);
}

.brand-logo img:hover {
    transform: scale(1.05);
    box-shadow: var(--gold-glow);
}

.brand-text h2 {
    font-size: 1.5rem;
    line-height: 1;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.nav-tab-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.nav-tab-btn.active {
    background: var(--gold-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-session-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 5px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

/* Tab Views */
.tab-view {
    display: none;
    padding: 40px 5%;
    min-height: calc(100vh - 80px);
}

.tab-view.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Hero Section */
.hero-banner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(rgba(12, 10, 9, 0.65), rgba(12, 10, 9, 0.88)), url('../assets/hero.png') center/cover no-repeat;
    padding: 90px 40px;
    margin-bottom: 50px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    max-width: 720px;
}

.hero-title {
    font-size: 3.2rem;
    line-height: 1.15;
    margin-bottom: 18px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.status-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 30px;
    color: var(--accent-green);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 1.8s infinite;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* B2B SERVICES STYLES */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.service-card {
    padding: 28px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.service-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--gold-light);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 18px;
}

.service-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--gold-primary);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 18px;
    flex-grow: 1;
}

.service-features-list {
    list-style: none;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

/* SAAS MODULES GRID STYLES */
.saas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
}

.saas-module-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.saas-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.saas-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.saas-header h4 { font-size: 1.1rem; }
.saas-code { font-size: 0.75rem; color: var(--text-muted); font-family: monospace; }

.saas-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 18px;
    flex-grow: 1;
}

.saas-card-footer {
    display: flex;
    justify-content: flex-end;
}

/* HR & RBAC MANAGEMENT STYLES */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-sub-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.sub-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.sub-tab-btn.active {
    background: var(--gold-light);
    color: var(--gold-primary);
}

/* Employee Cards Grid */
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
}

.employee-card {
    padding: 22px;
}

.emp-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    position: relative;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.emp-identity h4 {
    font-size: 1.1rem;
    line-height: 1.2;
}

.emp-code {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.status-pill {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.status-on_leave { background: rgba(245, 158, 11, 0.2); color: var(--gold-primary); }
.status-terminated { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }

.emp-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.detail-item {
    display: flex;
    justify-content: space-between;
}

.detail-item .label {
    color: var(--text-muted);
}

.emp-card-actions {
    display: flex;
    gap: 10px;
}

/* ORGANIZATIONAL CHART TREE VIEW */
.org-chart-wrapper {
    overflow-x: auto;
    padding: 30px 10px;
    text-align: center;
}

.org-tree-root {
    display: inline-block;
}

.org-node-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 20px;
}

.org-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--gold-primary);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    min-width: 220px;
    box-shadow: var(--shadow-main);
    display: inline-block;
    transition: var(--transition);
}

.org-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-primary);
}

.org-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.org-title { font-weight: 700; font-size: 1.05rem; }
.org-role { color: var(--gold-primary); font-size: 0.85rem; font-weight: 600; }
.org-dept { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }

.badge-pill {
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.org-children {
    display: flex;
    gap: 30px;
    position: relative;
    padding-top: 25px;
}

.org-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 25px;
    background: var(--border-color);
}

/* RBAC MATRIX TABLE */
.table-rbac-wrapper {
    overflow-x: auto;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.table-rbac {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-rbac th, .table-rbac td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.table-rbac th {
    background: var(--bg-secondary);
    text-align: center;
}

.perm-col-header { text-align: left !important; }

.perm-badge {
    background: var(--gold-light);
    color: var(--gold-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 8px;
}

.rbac-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-primary);
    cursor: pointer;
}

/* SECURITY SIMULATOR */
.perm-list-sim {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.sim-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.sim-item.granted { border-left: 4px solid var(--accent-green); }
.sim-item.denied { border-left: 4px solid var(--accent-red); opacity: 0.6; }

/* SHIFT SCHEDULER TABLE */
.table-shifts {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-shifts th, .table-shifts td {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.shift-pill {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.shift-morning { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.shift-evening { background: rgba(245, 158, 11, 0.2); color: var(--gold-primary); }
.shift-night { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.shift-off { background: var(--bg-secondary); color: var(--text-muted); }

/* MODALS & OVERLAYS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    outline: none;
}

.form-row {
    display: flex;
    gap: 14px;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gold-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    font-weight: 600;
}

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

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.animate-fade-in { animation: fadeIn 0.4s ease forwards; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 15px; }
    .hero-banner { padding: 40px 20px; }
    .hero-title { font-size: 2.2rem; }
    .form-row { flex-direction: column; }
}
