/* Pagenticator Admin Panel Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gray-100);
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.login-subtitle {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* Layout */
.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.version {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.nav-menu {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
}

.nav-menu li a {
    display: block;
    padding: 0.625rem 1.5rem;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.nav-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-menu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left: 3px solid var(--primary);
    padding-left: calc(1.5rem - 3px);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-link {
    color: var(--gray-500);
    text-decoration: none;
}

.logout-link:hover {
    color: white;
}

/* Content */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    max-width: 1200px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

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

.data-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gray-500);
    font-weight: 600;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: var(--gray-50);
}

.data-table a {
    color: var(--primary);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-active, .badge-completed { background: #dcfce7; color: #166534; }
.badge-suspended, .badge-paused, .badge-warning, .badge-pending { background: #fef3c7; color: #92400e; }
.badge-revoked, .badge-failed, .badge-disconnected { background: #fecaca; color: #991b1b; }
.badge-running { background: #dbeafe; color: #1e40af; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-full { width: 100%; text-align: center; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.required {
    color: var(--danger);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fecaca; color: #991b1b; border: 1px solid #fca5a5; }

/* Detail List */
.detail-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.5rem 1rem;
}

.detail-list dt {
    font-weight: 500;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.detail-list dd {
    font-size: 0.9rem;
}

/* Misc */
.inline-form { display: inline; }
.actions { white-space: nowrap; }
.actions .inline-form + .inline-form { margin-left: 0.25rem; }

.key-display {
    font-size: 0.8rem;
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.text-muted { color: var(--gray-500); }
.empty-state { color: var(--gray-500); text-align: center; padding: 2rem 0; }
.empty-state a { color: var(--primary); }

.error-log {
    background: var(--gray-900);
    color: #f87171;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

code {
    font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        flex-direction: row;
    }
    .content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
