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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 24px;
    color: #FFCC00;
    background: linear-gradient(135deg, #FFD71A, #FFB800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: #888;
    margin-top: 6px;
    font-size: 14px;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #1a1a2e;
    color: #fff;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: left 0.3s ease;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h2 {
    font-size: 18px;
    color: #FFCC00;
}

.admin-sidebar-header small {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.admin-nav {
    list-style: none;
    padding: 10px 0;
}

.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.admin-nav li a:hover,
.admin-nav li a.active {
    background: rgba(255,204,0,0.1);
    color: #FFCC00;
}

.admin-nav li a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.admin-nav li a .nav-label {
    white-space: nowrap;
}

.admin-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 20px;
}

.admin-main {
    margin-left: 250px;
    flex: 1;
    min-height: 100vh;
}

.admin-topbar {
    background: #fff;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar h1 {
    font-size: 20px;
    color: #333;
}

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

.admin-content {
    padding: 30px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #FFCC00;
    box-shadow: 0 0 0 3px rgba(255,204,0,0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group .form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: #FFCC00;
    color: #000;
}

.btn-primary:hover {
    background: #e6b800;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

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

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

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

.btn-full {
    width: 100%;
    justify-content: center;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

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

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

.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
}

.stat-box .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #FFCC00;
}

.stat-box .stat-title {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.tools-table {
    width: 100%;
    border-collapse: collapse;
}

.tools-table th,
.tools-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.tools-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
}

.tools-table tr:hover {
    background: #fafafa;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.badge-new {
    background: #ff6b6b;
    color: #fff;
}

.badge-improved {
    background: #FFCC00;
    color: #000;
}

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

.badge-disabled {
    background: #f8d7da;
    color: #721c24;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #4CAF50;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.color-preview {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #ddd;
    vertical-align: middle;
    margin-right: 8px;
}

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #888;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 14px;
}

.tab:hover {
    color: #333;
}

.tab.active {
    color: #000;
    border-bottom-color: #FFCC00;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 16px;
}

.back-link:hover {
    color: #333;
}

.admin-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    flex-shrink: 0;
}

.admin-menu-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.admin-sidebar-overlay.open {
    display: block;
}

.char-counter {
    font-weight: 600;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .admin-sidebar {
        left: -260px !important;
        width: 260px;
    }
    .admin-sidebar.open {
        left: 0 !important;
    }
    .admin-menu-btn {
        display: flex;
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-topbar {
        padding: 10px 12px;
        gap: 8px;
    }
    .admin-topbar h1 {
        font-size: 16px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .admin-topbar-actions .welcome-text {
        display: none;
    }
    .admin-content {
        padding: 15px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .tools-table {
        font-size: 13px;
    }
    .tools-table th,
    .tools-table td {
        padding: 8px 10px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .admin-content {
        padding: 10px;
    }
    .card {
        padding: 16px;
    }
    .admin-topbar h1 {
        font-size: 14px;
    }
    .stat-box .stat-number {
        font-size: 24px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}
