/* Admin Panel Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

/* Layout */
.wrap {
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px;
}

/* Login */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 32px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: #f0f6fc;
}

/* Header */
.hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 24px;
}

.hdr h1 {
    font-size: 1.5rem;
    color: #f0f6fc;
}

.hdr nav {
    display: flex;
    gap: 12px;
}

/* Messages */
.msg {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.msg.ok {
    background: #238636;
    color: #fff;
}

.msg.err {
    background: #da3633;
    color: #fff;
}

/* Stats Row */
.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
}

.stat {
    flex: 1;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat.pink { background: linear-gradient(135deg, #ec4899, #be185d); }
.stat.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.stat.green { background: linear-gradient(135deg, #10b981, #047857); }

.stat .val {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    display: block;
}

.stat .lbl {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
}

.stat form {
    margin-bottom: 8px;
}

/* Grid Layout */
.grid2 {
    display: flex;
    gap: 24px;
    margin-bottom: 28px;
}

.grid2 > * {
    flex: 1;
}

/* Cards */
.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 1.1rem;
    color: #f0f6fc;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #30363d;
}

/* Forms */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 14px;
}

.field input:focus {
    outline: none;
    border-color: #58a6ff;
}

.add-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.add-form .field {
    margin-bottom: 0;
}

.add-form .field.grow {
    flex: 1;
}

.row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.row .field {
    flex: 1;
    margin-bottom: 0;
}

/* Settings Form */
.settings-form .field {
    margin-bottom: 20px;
}

.field select {
    width: 100%;
    padding: 10px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    color: #c9d1d9;
    font-size: 14px;
    cursor: pointer;
}

.field select:focus {
    outline: none;
    border-color: #58a6ff;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #c9d1d9;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #58a6ff;
    cursor: pointer;
}

/* Color Inputs */
.color-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #0d1117;
    cursor: pointer;
}

.color-input input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input input[type="color"]::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

.color-value {
    font-family: monospace;
    font-size: 13px;
    color: #8b949e;
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #c9d1d9;
}

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

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
}

.btn:hover {
    background: #30363d;
}

.btn.green {
    background: #238636;
    color: #fff;
    border-color: #238636;
}

.btn.green:hover {
    background: #2ea043;
}

.btn.yellow {
    background: #9e6a03;
    color: #fff;
    border-color: #9e6a03;
}

.btn.red {
    background: #da3633;
    color: #fff;
    border-color: #da3633;
}

.btn.red:hover {
    background: #f85149;
}

.btn.light {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn.light:hover {
    background: rgba(255,255,255,0.3);
}

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

.btn.full {
    width: 100%;
}

/* Browser */
.browser {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    height: 180px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.br-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #21262d;
    cursor: pointer;
}

.br-row:hover {
    background: #161b22;
}

.br-row .icon {
    font-size: 16px;
}

.br-row .name {
    flex: 1;
    font-weight: 500;
}

.browser .loading,
.browser .error,
.browser .empty {
    padding: 16px;
    color: #6e7681;
    text-align: center;
}

.browser .error {
    color: #f85149;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: #0d1117;
}

th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b949e;
    font-weight: 600;
    border-bottom: 1px solid #30363d;
}

td {
    padding: 12px;
    border-bottom: 1px solid #21262d;
    vertical-align: middle;
}

.r {
    text-align: right;
}

.actions {
    white-space: nowrap;
}

.actions form {
    display: inline-block;
    margin-left: 6px;
}

.actions form:first-child {
    margin-left: 0;
}

.empty {
    text-align: center;
    color: #6e7681;
    padding: 20px !important;
}

code {
    font-family: monospace;
    font-size: 12px;
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 3px;
    color: #58a6ff;
}

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

.badge.on {
    background: #238636;
    color: #fff;
}

.badge.off {
    background: #6e7681;
    color: #fff;
}

/* Text colors */
.green-text { color: #3fb950; }
.yellow-text { color: #d29922; }
.red-text { color: #f85149; }

/* Responsive */
@media (max-width: 1200px) {
    .grid2 {
        flex-direction: column;
    }

    .stats {
        flex-wrap: wrap;
    }

    .stat {
        min-width: calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .stats {
        flex-direction: column;
    }

    .stat {
        min-width: 100%;
    }

    .add-form {
        flex-direction: column;
        align-items: stretch;
    }

    .add-form .btn {
        width: 100%;
    }

    .hdr {
        flex-direction: column;
        gap: 12px;
    }

    .row {
        flex-direction: column;
    }
}
