/**
 * ShadmanIT — Core Shared Design System (core.css)
 * 
 * Standalone CSS Architecture for Installer, Authentication, and CMS Admin.
 * Zero-dependency, zero-build-step, production-ready.
 */

:root {
    /* Brand Color Palette */
    --brand-red: #dc2626;
    --brand-red-hover: #ef4444;
    --brand-red-dark: #b91c1c;
    --brand-red-deep: #7f1d1d;
    --brand-red-dim: rgba(220, 38, 38, 0.12);
    --brand-red-glow: rgba(220, 38, 38, 0.35);

    /* Dark Surfaces */
    --bg-base: #07080c;
    --bg-surface: #0a0d14;
    --bg-card: #0f131d;
    --bg-card-hover: #151a27;
    --bg-card-active: #1b2131;
    --bg-input: #080a0f;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-brand: rgba(220, 38, 38, 0.35);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dim: #475569;

    /* Status Colors */
    --color-success: #10b981;
    --color-success-dim: rgba(16, 185, 129, 0.14);
    --color-success-border: rgba(16, 185, 129, 0.30);

    --color-warning: #f59e0b;
    --color-warning-dim: rgba(245, 158, 11, 0.14);
    --color-warning-border: rgba(245, 158, 11, 0.30);

    --color-error: #ef4444;
    --color-error-dim: rgba(239, 68, 68, 0.14);
    --color-error-border: rgba(239, 68, 68, 0.30);

    --color-info: #3b82f6;
    --color-info-dim: rgba(59, 130, 246, 0.14);
    --color-info-border: rgba(59, 130, 246, 0.30);

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-mono: 'ui-monospace', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Radii */
    --radius-sm: 0.375rem;
    --radius-md: 0.625rem;
    --radius-lg: 0.875rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-subtle);
    --shadow-popover: 0 20px 40px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-card);
    --shadow-brand: 0 8px 25px -4px rgba(220, 38, 38, 0.45);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100%;
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

svg {
    display: inline-block;
    vertical-align: middle;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.6875rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
    color: #ffffff;
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-red-hover) 0%, var(--brand-red) 100%);
    box-shadow: 0 10px 28px -4px rgba(220, 38, 38, 0.6);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-card);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    color: #ffffff;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-danger {
    background: var(--color-error-dim);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

.btn-danger:hover {
    background: var(--color-error);
    color: #ffffff;
}

.btn-sm {
    padding: 0.4375rem 0.875rem;
    font-size: 0.75rem;
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    border-radius: var(--radius-xl);
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4375rem;
    letter-spacing: 0.02em;
}

.form-label .required {
    color: var(--brand-red);
    margin-left: 0.25rem;
}

.form-control, .form-select, .form-textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 0.6875rem 0.9375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-control::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.20);
    background-color: #0c0f16;
}

.form-control:disabled, .form-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.form-error {
    font-size: 0.75rem;
    color: var(--color-error);
    margin-top: 0.375rem;
    font-weight: 500;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-group .form-control {
    padding-right: 2.75rem;
}

.input-group-btn {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.375rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.input-group-btn:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Switches & Checkboxes
   ========================================================================== */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: relative;
    width: 42px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease;
    border: 1px solid var(--border-card);
    flex-shrink: 0;
}

.switch-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.switch input:checked + .switch-slider {
    background-color: var(--brand-red);
    border-color: var(--brand-red);
}

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

/* Checkbox Custom */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
    border: 1px solid var(--border-card);
    accent-color: var(--brand-red);
    cursor: pointer;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   Status Badges & Chips
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: var(--font-mono);
    line-height: 1.2;
    border: 1px solid transparent;
}

.badge-success {
    background-color: var(--color-success-dim);
    border-color: var(--color-success-border);
    color: var(--color-success);
}

.badge-warning {
    background-color: var(--color-warning-dim);
    border-color: var(--color-warning-border);
    color: var(--color-warning);
}

.badge-danger {
    background-color: var(--color-error-dim);
    border-color: var(--color-error-border);
    color: var(--color-error);
}

.badge-info {
    background-color: var(--color-info-dim);
    border-color: var(--color-info-border);
    color: var(--color-info);
}

.badge-neutral {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.badge-brand {
    background-color: var(--brand-red-dim);
    border-color: var(--brand-red-glow);
    color: var(--brand-red-hover);
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--color-success-dim);
    border-color: var(--color-success-border);
    color: #34d399;
}

.alert-error {
    background-color: var(--color-error-dim);
    border-color: var(--color-error-border);
    color: #f87171;
}

.alert-warning {
    background-color: var(--color-warning-dim);
    border-color: var(--color-warning-border);
    color: #fbbf24;
}

.alert-info {
    background-color: var(--color-info-dim);
    border-color: var(--color-info-border);
    color: #60a5fa;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8125rem;
}

.table th {
    padding: 0.875rem 1rem;
    background-color: #090c13;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.table td {
    padding: 0.9375rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   Empty States & Skeletons
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-dim);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.empty-state-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    max-width: 380px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

/* ==========================================================================
   Spinners & Loaders
   ========================================================================== */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Utility Helpers
   ========================================================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.text-white { color: #ffffff !important; }
.text-muted { color: var(--text-muted) !important; }
.text-brand { color: var(--brand-red) !important; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flexbox & Layout Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.shrink-0 { flex-shrink: 0; }
.space-y-4 > * + * { margin-top: 1rem; }

/* SVG Sizing Utilities */
svg {
    display: inline-block;
    vertical-align: middle;
}
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-3\.5, .w-3-5 { width: 0.875rem; }
.h-3\.5, .h-3-5 { height: 0.875rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-14 { width: 3.5rem; }
.h-14 { height: 3.5rem; }


