@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc;
    --sidebar-bg: #111111;         /* Sleek Charcoal Dark Sidebar */
    --sidebar-text: #94a3b8;       /* Slate Grey */
    --sidebar-hover: #1f1f1f;
    --sidebar-active: #C81010;     /* Primary Brand Red */
    
    --card-bg: #ffffff;
    --border-color: #f1f5f9;       /* Ultra-soft border */
    --text-main: #0f172a;          /* Slate 900 for dark text */
    --text-muted: #64748b;         /* Slate 500 for captions */
    
    --primary: #C81010;            /* Primary Red brand */
    --primary-hover: #a80c0c;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #D6A047;            /* Elegant Gold */
    --info: #06b6d4;
    
    /* Standardized soft radius tokens */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    
    /* Premium shadows system */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    padding: 18px 24px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.sidebar-brand img {
    max-width: 100%;
    max-height: 40px;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.sidebar-brand img:hover {
    transform: scale(1.02);
}

.sidebar-menu {
    list-style: none;
    padding: 24px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    padding-left: 22px;
}

.sidebar-link:hover i {
    color: var(--primary);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(200, 16, 16, 0.08) 0%, rgba(200, 16, 16, 0.01) 100%);
    color: #fff;
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--primary);
}

.sidebar-link.highlight-link {
    color: var(--warning);
    border-left-color: transparent;
}

.sidebar-link.highlight-link:hover {
    color: #fff;
    background: rgba(214, 160, 71, 0.1);
}

.sidebar-link i {
    width: 20px;
    font-size: 1.15rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.sidebar-link:hover i {
    transform: translateX(1px);
}

.sidebar-footer {
    margin-top: auto;
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
    color: #555555;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Main Dashboard Panel */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 40px;
    min-height: 100vh;
    background-color: var(--bg-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top Navbar */
.admin-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 6px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.user-profile:hover {
    box-shadow: var(--shadow);
    border-color: #cbd5e1;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-role {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(200, 16, 16, 0.1) 0%, rgba(200, 16, 16, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
    border: 1.5px solid rgba(200, 16, 16, 0.15);
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(200, 16, 16, 0.12);
}

.stat-info h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-icon.primary { background: rgba(200, 16, 16, 0.08); color: var(--primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.08); color: var(--success); }
.stat-icon.warning { background: rgba(214, 160, 71, 0.08); color: var(--warning); }
.stat-icon.info { background: rgba(6, 182, 212, 0.08); color: var(--info); }

/* Dashboard Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: #e2e8f0;
}

.card-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.card-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 28px;
}

.card-body.p-0 {
    padding: 0;
}

/* Custom Premium Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    padding: 16px 28px;
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
    color: #334155;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.table tr:last-child td {
    border-bottom: none;
}

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

.table tbody tr:hover td {
    background: #fafbfc;
}

/* Badge Status Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-new { background: #eff6ff; color: #1d4ed8; }
.badge-contacted { background: #fffbeb; color: #b45309; }
.badge-closed { background: #ecfdf5; color: #047857; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-published { background: #ecfdf5; color: #047857; }

/* Dashboard Actions */
.actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--text-main);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-icon.delete:hover {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fca5a5;
}

.btn-icon i {
    font-size: 0.95rem;
}

/* Forms in CMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.01em;
}

.form-control {
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text-main);
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(200, 16, 16, 0.08);
}

.form-control::placeholder {
    color: #94a3b8;
}

textarea.form-control {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

/* Buttons in CMS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(200, 16, 16, 0.1);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(200, 16, 16, 0.2);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border: 1.5px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.02);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

/* Notifications alerts */
.alert {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
    font-size: 0.92rem;
    font-weight: 550;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

/* Responsiveness in CMS */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .main-content {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 76px;
    }
    
    .sidebar-brand {
        padding: 18px 8px;
    }
    
    .sidebar-brand span, .sidebar-link span, .sidebar-footer span {
        display: none;
    }
    
    .sidebar-link {
        padding: 12px;
        justify-content: center;
    }
    
    .sidebar-link:hover {
        padding-left: 12px;
    }
    
    .main-content {
        margin-left: 76px;
        padding: 24px 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .user-profile {
        align-self: flex-end;
    }
}
