@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

:root { 
    --bg: #0B0F19; 
    --card: #131A2A; 
    --card-glass: rgba(19, 26, 42, 0.85);
    --card-hover: #1E293B; 
    --accent: #00FF9D; 
    --text: #E2E8F0; 
    --muted: #64748B;
    --border: rgba(255, 255, 255, 0.1);
    --error: #ff4757;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Space Grotesk', sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

/* Dashboard Background */
.dashboard-bg { background-image: radial-gradient(var(--muted) 1px, transparent 1px); background-size: 40px 40px; }
.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }

/* Buttons & Inputs */
.input-style { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: #fff; padding: 14px 18px; border-radius: 12px; font-size: 1rem; outline: none; transition: 0.3s; }
.input-style:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(0, 255, 157, 0.2); }

.btn { display: inline-block; background: var(--accent); color: #000; font-weight: 700; border: none; padding: 14px 24px; border-radius: 12px; font-size: 1rem; cursor: pointer; transition: 0.3s; text-decoration: none; text-align: center; }
.btn:hover { box-shadow: 0 0 15px rgba(0, 255, 157, 0.4); transform: translateY(-2px); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--muted); box-shadow: none; transform: none; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; cursor: pointer; font-weight: 600; border: none; transition: 0.2s; }
.btn-outline { background: transparent; border: 1px solid var(--muted); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; border: 1px solid var(--error); color: var(--error); }
.btn-danger:hover { background: rgba(255,71,87,0.1); }

/* Auth Layout */
.auth-layout { display: flex; min-height: 100vh; overflow: hidden; }
.brand-panel { flex: 1.2; background: radial-gradient(circle at top left, #131A2A, #0B0F19); padding: 50px; display: flex; flex-direction: column; justify-content: center; position: relative; }
.brand-panel::before { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background-image: radial-gradient(var(--muted) 1px, transparent 1px); background-size: 30px 30px; opacity: 0.1; }
.brand-panel h1 { font-size: 4rem; color: #fff; margin-bottom: 15px; position: relative; z-index: 2; }
.brand-panel span { color: var(--accent); }
.brand-panel p { font-size: 1.2rem; color: var(--muted); max-width: 450px; position: relative; z-index: 2; }
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; border-left: 1px solid var(--border); }
.auth-card { background: var(--card-glass); border: 1px solid var(--border); padding: 40px; border-radius: 24px; width: 100%; max-width: 450px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); backdrop-filter: blur(10px); }

/* Header & Cards */
.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; background: var(--card-glass); padding: 20px 30px; border-radius: 16px; border: 1px solid var(--border); backdrop-filter: blur(10px); }
.panel-card { background: var(--card); padding: 30px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 30px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
.tree-card { background: var(--card); border: 1px solid var(--border); padding: 30px; border-radius: 20px; transition: 0.3s; cursor: pointer; display: flex; flex-direction: column; }
.tree-card:hover { transform: translateY(-5px); border-color: rgba(0, 255, 157, 0.4); background: var(--card-hover); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

/* Hierarchy List Styles */
.node-list { list-style: none; padding-left: 40px; border-left: 2px solid rgba(255,255,255,0.05); margin-top: 15px; }
.node-list:first-child { padding-left: 0; border-left: none; }
.node-item { margin-bottom: 15px; position: relative; }
.node-item::before { content: ''; position: absolute; top: 25px; left: -40px; width: 30px; height: 2px; background: rgba(255,255,255,0.05); }
.node-list:first-child > .node-item::before { display: none; }

.node-card { background: var(--card); border: 1px solid var(--border); padding: 20px; border-radius: 16px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; transition: 0.2s; }
.node-card:hover { border-color: rgba(0, 255, 157, 0.3); }
.node-data { flex: 1; min-width: 200px; }
.node-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 100; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-content { background: var(--card); padding: 35px; border-radius: 20px; border: 1px solid var(--border); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }

/* Mobile */
@media (max-width: 900px) { .auth-layout { flex-direction: column; overflow: auto; } .brand-panel { padding: 40px 20px; text-align: center; border-bottom: 1px solid var(--border); } }
@media (max-width: 600px) { 
    .top-nav { flex-direction: column; gap: 15px; text-align: center; } 
    .node-list { padding-left: 15px; } 
    .node-item::before { width: 10px; left: -15px; } 
    
    /* NEW: Fixes the text overflow and stacking on mobile */
    .node-content-wrapper { flex-direction: column; gap: 10px; min-width: 0; width: 100%; }
    .node-data { width: 100%; word-break: break-word; overflow-wrap: break-word; }
    .node-actions { width: 100%; justify-content: flex-start; }
    .node-card { padding: 15px; }
}