:root {
    --bg-color: #f3f4f6;
    --sidebar-dark: #1e293b;
    --sidebar-dark-active: #0f172a;
    --sidebar-light: #ffffff;
    --primary: #3b82f6;
    --border: #e5e7eb;
    --text-main: #374151;
    --text-muted: #6b7280;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-main); display: flex; flex-direction: column; min-height: 100vh; }

/* Navbar */
.navbar { height: 50px; display: flex; align-items: center; justify-content: space-between; padding-right: 1.5rem; position: relative; z-index: 10; }
.navbar .brand { text-decoration: none; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }

/* Layout */
.ma-layout { display: flex; flex: 1; overflow: hidden; }

/* Dark Sidebar (Tier 1) */
.ma-sidebar-dark { width: 60px; background-color: var(--sidebar-dark); color: #94a3b8; display: flex; flex-direction: column; align-items: center; padding-top: 1rem; z-index: 5; }
.ma-sidebar-dark .mod-link { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; padding: 0.8rem 0.2rem; text-align: center; text-decoration: none; color: #94a3b8; font-size: 0.7rem; gap: 0.3rem; transition: background 0.2s; box-sizing: border-box; }
.ma-sidebar-dark .mod-link:hover { background: var(--sidebar-dark-active); color: white; }
.ma-sidebar-dark .mod-link.active { background: var(--primary); color: white; border-left: 3px solid #60a5fa; }
.ma-sidebar-dark .mod-link i { font-size: 1.4rem; }

/* Light Sidebar (Tier 2) */
.ma-sidebar-light { width: 250px; background-color: var(--sidebar-light); border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.ma-sidebar-light .section-title { padding: 1rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }

/* Tree Menu */
.tree-menu { list-style: none; padding: 0.5rem 0; }
.tree-menu li { position: relative; }
.tree-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem 0.4rem 1.5rem; color: var(--text-main); text-decoration: none; font-size: 0.9rem; cursor: pointer; transition: background 0.2s; }
.tree-item:hover { background: #f3f4f6; }
.tree-item.active { background: #e0f2fe; color: #0369a1; font-weight: 500; border-right: 3px solid var(--primary); }
.tree-item i.ph-caret-right { font-size: 0.8rem; color: var(--text-muted); transition: transform 0.2s; }
.tree-item i.icon-main { font-size: 1.1rem; color: #64748b; }
.tree-children { list-style: none; padding-left: 1.5rem; display: none; }
li.expanded > .tree-item i.ph-caret-right { transform: rotate(90deg); }
li.expanded > .tree-children { display: block; }

/* Content Area */
.ma-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: white; }
.ma-toolbar { padding: 0.8rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; background: #f9fafb; }
.ma-main-area { flex: 1; overflow-y: auto; padding: 1.5rem; }

.ma-page-header { margin-bottom: 1.5rem; }
.ma-page-title { font-size: 1.25rem; font-weight: 600; color: #111827; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.45rem 1rem; border-radius: 6px; font-size: 0.85rem; font-weight: 500; cursor: pointer; border: 1px solid #cbd5e1; text-decoration: none; transition: all 0.2s ease; background: #ffffff; color: #475569; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.btn:hover { background: #f8fafc; border-color: #94a3b8; color: #1e293b; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn:active { background: #f1f5f9; transform: translateY(1px); box-shadow: none; }
.btn-primary { background-color: #3b82f6; color: white; border-color: #3b82f6; box-shadow: 0 1px 2px rgba(59, 130, 246, 0.2); }
.btn-primary:hover { background-color: #2563eb; color: white; border-color: #2563eb; box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3); }
.btn-danger { background-color: #ffffff; color: #ef4444; border-color: #fca5a5; }
.btn-danger:hover { background-color: #fef2f2; border-color: #ef4444; color: #dc2626; }
.btn i.ph { font-size: 1.1rem; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; overflow-y: auto; max-height: calc(100vh - 220px); }
.ma-table { width: 100%; border-collapse: collapse; }
.ma-table th, .ma-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85rem; white-space: nowrap; }
.ma-table th { background: #f9fafb; font-weight: 600; color: var(--text-muted); white-space: nowrap; position: sticky; top: 0; z-index: 10; }
.ma-table tr:hover { background: #f8fafc; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-content { background: white; width: 100%; max-width: 550px; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(0,0,0,0.05); }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.modal-title { font-weight: 600; font-size: 1rem; color: #0f172a; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); transition: color 0.2s; }
.modal-close:hover { color: #b91c1c; }
.modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; background: #f8fafc; }

/* Form Elements */
.form-group { margin-bottom: 0.85rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-size: 0.8rem; font-weight: 500; color: #475569; }
.form-control { width: 100%; padding: 0.4rem 0.6rem; background-color: #f8fafc; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 0.85rem; font-family: inherit; color: #1e293b; transition: all 0.2s; }
.form-control:focus { outline: none; background-color: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }

/* Badges */
.badge { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }
.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-green { background: #dcfce3; color: #15803d; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Dashboard Cards */
.ma-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.ma-card { background: white; border: 1px solid var(--border); border-radius: 6px; }
.ma-card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 600; background: #f8fafc; }

/* Notifications */
.notif-dropdown { display: none; position: absolute; top: 100%; right: 0; background: white; border: 1px solid var(--border); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border-radius: 6px; width: 300px; z-index: 1000; margin-top: 0.5rem; }
.notif-dropdown.show { display: block; }
.notif-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f0f9ff; }
.notif-badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; font-size: 0.6rem; font-weight: bold; padding: 2px 5px; border-radius: 10px; }.ma-card-body { padding: 1.5rem; }
