/* ============================================================
   Webbersites Platform - Core Styles
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Navigation ---- */

.platform-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo { text-decoration: none; display: flex; align-items: center; }
.nav-logo img { height: 36px; }
.logo-text { font-size: 20px; font-weight: 700; color: var(--primary); }

.nav-user { display: flex; align-items: center; gap: 16px; }
.nav-user-name { font-size: 14px; color: var(--text-secondary); }
.nav-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
}
.nav-link:hover { text-decoration: underline; }

/* ---- Layout ---- */

main { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
main.embed-mode { max-width: 100%; padding: 16px; }

.page-header {
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* ---- Cards ---- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- Buttons ---- */

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

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ---- Forms ---- */

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
    font-family: inherit;
}

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

select.form-input { cursor: pointer; }
textarea.form-input { min-height: 100px; resize: vertical; }

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

/* ---- Tables ---- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f1f5f9; }

/* ---- Badges ---- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ---- Auth Pages ---- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.auth-card .form-group { text-align: left; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Alert / Message ---- */

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

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- Tool Card ---- */

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow 0.15s;
}
.tool-card:hover { box-shadow: var(--shadow); }

.tool-icon {
    width: 48px;
    height: 48px;
    background: var(--bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.tool-info { flex: 1; }
.tool-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.tool-info p { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }

/* ---- Admin Sidebar Layout ---- */

.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    color: var(--primary);
    background: #eff6ff;
}
.admin-sidebar a i { width: 20px; text-align: center; }

.admin-sidebar .sidebar-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 20px 24px 8px;
    font-weight: 600;
}

.admin-content {
    padding: 32px;
    max-width: 1000px;
}

/* ---- Footer ---- */

.platform-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    main { padding: 20px 16px; }
    .auth-card { padding: 24px; }
}
