/* =========================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================= */
:root {
    --primary-color: #587685; 
    --primary-light: #7a95a3; 
    --bg-main: #f0f2f5; 
    --text-dark: #222222;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 90px;
    
    --attention: #ef4444;
    --working: #f59e0b;
    --approved: #10b981;
    --victory-gold: #d4af37; 
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', system-ui, sans-serif; }
body { background-color: var(--bg-main); display: flex; height: 100vh; overflow: hidden; cursor: none; }

/* =========================================================
   2. SMART CURSOR (Desktop Only)
   ========================================================= */
@media (pointer: coarse) {
    #cursor-dot, #cursor-ring { display: none !important; }
    body { cursor: auto; }
    a, button, input, .brand-card, .emp-card, .task-card { cursor: pointer; }
}

@media (pointer: fine) {
    body { cursor: none; }
    a, button, input, select, textarea, .brand-card, .file-card, .asset-card, .software-card, .task-card, .victory-card, .sidebar-toggle, .checkbox-label { cursor: none; }
    
    #cursor-dot, #cursor-ring { 
        position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999999; 
        transform: translate(-50%, -50%); mix-blend-mode: difference; will-change: transform; 
    }
    #cursor-dot { width: 8px; height: 8px; background-color: white; border-radius: 50%; }
    #cursor-ring { 
        width: 40px; height: 40px; border: 1px solid white; border-radius: 50%; 
        transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), height 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
    }
}

/* =========================================================
   3. SIDEBAR & LAYOUT
   ========================================================= */
.sidebar { width: var(--sidebar-width); background-color: white; padding: 25px; display: flex; flex-direction: column; margin: 15px; border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.04); transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; z-index: 100; flex-shrink: 0; }
.sidebar.collapsed { width: var(--sidebar-collapsed-width); padding: 25px 15px; }
.sidebar.collapsed .nav-text, .sidebar.collapsed .menu-heading { display: none; }
.sidebar.collapsed .menu-item, .sidebar.collapsed .brand-logo { justify-content: center; }
.sidebar.collapsed .menu-item i { margin-right: 0; font-size: 1.5rem; }

.brand-logo { font-size: 1.1rem; font-weight: 700; color: var(--primary-color); margin-bottom: 30px; display: flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap;}
.brand-logo img { height: 45px; flex-shrink: 0; }
.menu-heading { font-size: 0.7rem; text-transform: uppercase; color: #aaa; margin: 20px 15px 10px; font-weight: 800; letter-spacing: 1px; white-space: nowrap;}
.menu-item { display: flex; align-items: center; text-decoration: none; color: #64748b; padding: 12px 16px; margin-bottom: 4px; border-radius: 14px; transition: 0.3s; font-weight: 600; white-space: nowrap; }
.menu-item i { margin-right: 12px; font-size: 1.3rem; flex-shrink: 0; }
.menu-item.active { background-color: var(--primary-color); color: white; box-shadow: 0 8px 20px rgba(88, 118, 133, 0.25); }
.menu-item:hover:not(.active) { background-color: #f1f5f9; color: var(--primary-color); }

.main-content { flex: 1; padding: 30px 40px; overflow-y: auto; display: flex; flex-direction: column; transition: all 0.4s ease; position: relative; width: 100%; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 35px; gap: 20px; }
.header-left { display: flex; align-items: center; gap: 20px; }
.sidebar-toggle, .toggle-btn { background: white; border: none; color: var(--primary-color); font-size: 1.6rem; padding: 10px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; transition: 0.2s; cursor: pointer;}
.sidebar-toggle:hover, .toggle-btn:hover { background: var(--bg-main); transform: scale(1.05); }

/* Buttons */
.btn-primary { background: var(--primary-color); color: white; border: none; padding: 16px 36px; border-radius: 50px; font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 12px; transition: 0.3s; box-shadow: 0 6px 20px rgba(88, 118, 133, 0.25); }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(88, 118, 133, 0.35); }

/* =========================================================
   4. CARDS & GRIDS (SPLIT CONFIG)
   ========================================================= */
.section-title { color: var(--text-dark); margin-bottom: 20px; font-size: 1.2rem; margin-top: 10px; font-weight: 800;}

/* GROUP 1: Standard Cards (3 Columns) */
.brand-overview-grid, 
.software-grid, 
.victory-grid, 
.employee-grid, 
.login-grid, 
.guide-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); /* 3 Cards per row */
    gap: 20px; 
    margin-bottom: 40px; 
    padding-bottom: 100px;
}

/* GROUP 2: File/Folder Cards (5 Columns) */
.file-grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); /* 5 Folders per row */
    gap: 15px; 
    padding-bottom: 100px;
}

/* Brand Cards */
.brand-card { background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%); color: white; padding: 25px; border-radius: 20px; height: 160px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; box-shadow: 0 8px 20px rgba(88, 118, 133, 0.3); transition: 0.3s ease; overflow: hidden; position: relative; }
.brand-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(88, 118, 133, 0.4); }
.brand-card-text h3 { font-size: 1.5rem; margin-bottom: 5px; font-weight: 800;}
.brand-card-text p { font-size: 0.9rem; opacity: 0.9; }

/* --- ICON FIX: BIGGER & SHIFTED LEFT --- */
i.brand-card-icon { 
    font-size: 9rem; /* Bigger */
    opacity: 0.25; 
    transition: 0.4s ease; 
    transform: rotate(-10deg); 
    position: absolute; 
    right: 20px; /* Moved Left to be visible */
    bottom: -15px; 
}
.brand-card:hover i.brand-card-icon { opacity: 0.9; transform: rotate(0deg) scale(1.05); }

img.brand-card-icon { 
    height: 160px; /* Bigger */
    width: 160px; 
    object-fit: contain; 
    object-position: right center; 
    opacity: 0.4; 
    transition: 0.4s ease; 
    position: absolute; 
    right: 20px; /* Moved Left to be visible */
}
.brand-card:hover img.brand-card-icon { opacity: 1; transform: scale(1.1); }

/* Asset Cards */
.asset-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: 0 8px 20px rgba(88, 118, 133, 0.1); transition: 0.3s; display: flex; flex-direction: column; border: 1px solid transparent; position: relative; }
.asset-card:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(88, 118, 133, 0.3); border-color: var(--primary-light);}
.preview-area { height: 140px; background: #f9f9f9; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.preview-area img { width: 100%; height: 100%; object-fit: cover; }
.preview-area .type-icon { font-size: 4rem; color: #ddd; } 
.asset-card.is-folder .preview-area { background: var(--primary-color); }
.asset-card.is-folder .type-icon { color: rgba(255,255,255,0.4); }
.info-area { padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.info-area h3, .info-area h4 { font-size: 0.9rem; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; max-width: 140px; }
.info-area p { font-size: 0.7rem; color: #888; }

/* Software/Login Cards */
.software-card, .login-card { background: white; border-radius: 24px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); transition: 0.3s; border: 1px solid rgba(0,0,0,0.01); position: relative; }
.software-card:hover, .login-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--primary-light); }

/* Victory Cards */
.victory-card { background: white; border-radius: 16px; padding: 25px; border: 1px solid #e2e8ea; position: relative; display: flex; flex-direction: column; box-shadow: 0 4px 15px rgba(0,0,0,0.02); transition: 0.3s; cursor: none; overflow: hidden; }
.victory-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(245, 158, 11, 0.1); border-color: #fcd34d; }

/* Search & Filter */
.toolbar { display: flex; gap: 20px; margin-bottom: 30px; align-items: center; flex-wrap: wrap; }
.search-style { background: white; padding: 12px 20px; border-radius: 50px; display: flex; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid transparent; transition: 0.3s; width: 100%; max-width: 350px; }
.search-style:hover, .search-style:focus-within { box-shadow: 0 8px 25px rgba(88, 118, 133, 0.15); border-color: var(--primary-light); }
.search-box input { border: none; outline: none; margin-left: 12px; width: 100%; font-size: 0.95rem; background: transparent; color: var(--text-dark); }
.filter-box { position: relative; cursor: pointer; min-width: 180px; justify-content: space-between; }
.filter-box select { appearance: none; border: none; background: transparent; width: 100%; outline: none; font-size: 0.9rem; color: var(--text-dark); cursor: pointer; z-index: 2; }
.filter-box i { pointer-events: none; }

/* Loaders */
.loader-container { grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 300px; color: #64748b; gap: 20px; }
.spinner { border: 4px solid rgba(88, 118, 133, 0.2); border-top: 4px solid var(--primary-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================================
   5. UTILITIES (Modals, Forms, FABs)
   ========================================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); z-index: 2000; display: none; justify-content: center; align-items: center; }
.modal-card { background: white; padding: 40px; border-radius: 30px; width: 100%; max-width: 650px; box-shadow: 0 25px 50px rgba(0,0,0,0.15); max-height: 90vh; overflow-y: auto; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 14px; border-radius: 14px; border: 2px solid #f1f5f9; outline: none; transition: 0.2s; font-size: 0.95rem; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary-color); background: #f9fbfc; }

.fab-menu-container { position: fixed; bottom: 40px; right: 40px; display: flex; flex-direction: column-reverse; align-items: center; gap: 15px; z-index: 1000; }
.fab-main { width: 65px; height: 65px; background: var(--text-dark); color: white; border-radius: 50%; border: none; display: flex; justify-content: center; align-items: center; font-size: 2rem; box-shadow: 0 8px 25px rgba(0,0,0,0.2); transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: none;}
.fab-item { width: 50px; height: 50px; background: white; color: var(--text-dark); border-radius: 50%; border: none; display: flex; justify-content: center; align-items: center; font-size: 1.4rem; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: 0.3s; opacity: 0; visibility: hidden; transform: translateY(20px); position: relative; cursor: none;}
.fab-menu-container.active .fab-main { transform: rotate(135deg); background: var(--primary-color); }
.fab-menu-container.active .fab-item { opacity: 1; visibility: visible; transform: translateY(0); }
.fab-item:hover { background: var(--bg-main); color: var(--primary-color); transform: scale(1.1) !important; }

/* Login Portal Box */
.login-container { background: white; padding: 50px 40px; border-radius: 24px; box-shadow: 0 15px 35px rgba(0,0,0,0.05); width: 100%; max-width: 420px; text-align: center; }
.input-group { position: relative; margin-bottom: 20px; text-align: left; }
.input-group i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 1.2rem; }
.input-group input { width: 100%; padding: 16px 16px 16px 50px; border-radius: 12px; border: 2px solid #eee; outline: none; font-size: 1rem; transition: 0.3s; }
.input-group input:focus { border-color: var(--primary-color); }

/* =========================================================
   6. RESPONSIVE LOGIC (Tablet & Mobile)
   ========================================================= */
@media (max-width: 1200px) {
    /* Tablet Landscape: 3 Columns for everyone */
    .brand-overview-grid, .file-grid, .software-grid, .victory-grid, .employee-grid, .login-grid, .guide-grid { 
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 900px) {
    /* Tablet Portrait: 2 Columns */
    .header { align-items: flex-start; }
    .search-style { max-width: 100%; width: 100%; }
    
    .brand-overview-grid, .file-grid, .software-grid, .victory-grid, .employee-grid, .login-grid, .guide-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 768px) {
    /* Mobile: 1 Column */
    .sidebar { position: fixed; top: 0; left: -300px; height: 100vh; margin: 0; border-radius: 0; width: 280px; z-index: 2000; box-shadow: 5px 0 25px rgba(0,0,0,0.2); }
    .sidebar.mobile-open { left: 0; }

    .mobile-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1500; display: none; backdrop-filter: blur(3px); }
    .mobile-overlay.active { display: block; }

    .main-content { padding: 20px; width: 100%; }
    .header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-left { width: 100%; justify-content: space-between; }
    
    .brand-overview-grid, .file-grid, .software-grid, .victory-grid, .employee-grid, .login-grid, .guide-grid { 
        grid-template-columns: 1fr; 
    }
    
    .modal-card { width: 100%; height: 100%; border-radius: 0; max-height: 100vh; padding: 25px; }
    .modal-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* =========================================================
   7. SPOTLIGHT GLOW EFFECT (Original Desktop Hover)
   ========================================================= */
.brand-card, .asset-card, .login-card, .victory-card, .guide-card, .emp-card, .task-card {
    position: relative;
    overflow: hidden; 
}

.brand-card::before, .asset-card::before, .login-card::before, .victory-card::before, .guide-card::before, .emp-card::before, .task-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(600px circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.15), transparent 40%);
    opacity: 0; 
    transition: opacity 0.5s ease;
    pointer-events: none; 
    z-index: 2;
}

.brand-card:hover::before, .asset-card:hover::before, .login-card:hover::before, .victory-card:hover::before, .guide-card:hover::before, .emp-card:hover::before, .task-card:hover::before {
    opacity: 1;
}