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

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
}

/* Material Symbols Settings */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 20;
    vertical-align: middle;
    user-select: none;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1a1d23;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .material-symbols-outlined {
    font-size: 32px;
    color: #2196F3;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2196F3;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}

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

.content-header h1 {
    font-size: 1.8rem;
    color: #1a1d23;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    color: #1a1d23;
}

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

.card-body {
    padding: 25px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: #2196F3;
    color: #fff;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #f44336;
    color: #fff;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    color: #6c757d;
}

.btn-icon:hover {
    background: #f0f2f5;
    color: #2196F3;
}

.btn-icon.btn-danger:hover {
    background: #ffebee;
    color: #f44336;
}

/* Menu Tree */
.menu-tree {
    max-width: 100%;
}

.tree-list {
    list-style: none;
    padding: 0;
}

.tree-item {
    margin-bottom: 5px;
}

.tree-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8eaed;
    transition: all 0.3s ease;
}

.tree-item-content:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tree-item-content.inactive {
    opacity: 0.6;
}

.drag-handle {
    cursor: move;
    color: #9e9e9e;
    display: flex;
}

.drag-handle:hover {
    color: #2196F3;
}

.tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tree-toggle:hover {
    background: rgba(33, 150, 243, 0.1);
}

.tree-toggle .material-symbols-outlined {
    transition: transform 0.3s ease;
}

.tree-toggle.collapsed .material-symbols-outlined {
    transform: rotate(-90deg);
}

.tree-spacer {
    width: 28px;
}

.tree-icon {
    color: #2196F3;
    font-size: 20px;
}

.tree-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tree-title {
    font-weight: 500;
    color: #1a1d23;
}

.tree-url {
    font-size: 12px;
    color: #9e9e9e;
}

.tree-actions {
    display: flex;
    gap: 5px;
}

.tree-children {
    margin-left: 40px;
    margin-top: 5px;
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: #1a1d23;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #1a1d23;
}

.modal-body {
    padding: 25px;
}

.modal-body form {
    margin: 0;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.icon-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-input-group input {
    flex: 1;
}

.icon-preview {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #2196F3;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
}

small a {
    color: #2196F3;
    text-decoration: none;
}

small a:hover {
    text-decoration: underline;
}

/* Messages */
#messageContainer {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.text-warning {
    color: #856404;
    font-size: 13px;
    margin-top: 10px;
}

/* Sortable Styles */
.ui-sortable-helper {
    opacity: 0.8;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.ui-sortable-placeholder {
    background: #e3f2fd;
    border: 2px dashed #2196F3;
    visibility: visible !important;
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .tree-item-content {
        flex-wrap: wrap;
    }
    
    .tree-info {
        flex: 1 1 100%;
        margin-left: 38px;
    }
    
    .tree-actions {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .tree-children {
        margin-left: 20px;
    }
}