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

:root {
    --primary: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary: #10B981; /* Emerald */
    --secondary-hover: #059669;
    --primary-light: rgba(79, 70, 229, 0.1);
    --secondary-light: rgba(16, 185, 129, 0.1);
    
    --background: #F8FAFC;
    --surface: #FFFFFF;
    
    --text-main: #1E293B;
    --text-muted: #64748B;
    
    --border: #E2E8F0;
    --danger: #EF4444;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 3rem;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 15px rgba(0,0,0,0.02);
    z-index: 10;
}

.sidebar .brand {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2.5rem;
    text-align: center;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 0.75rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-links a ion-icon {
    font-size: 1.25rem;
    margin-right: 12px;
    transition: transform var(--transition-fast);
}

.nav-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-links a:hover ion-icon {
    transform: scale(1.1);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.main-content {
    flex: 1;
    padding: 2.5rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Premium Glass Cards */
.premium-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,1);
    padding: 2rem;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-icon {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    color: var(--primary);
    padding: 0.6rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Auth / Login specific */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #4F46E5, #10B981, #3B82F6, #8B5CF6);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.form-control:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

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

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-light);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 15px var(--secondary-light);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

/* Modern Tables */
.table-container {
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-top: -0.5rem;
}

.modern-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    text-align: left;
}

.modern-table td {
    background: var(--background);
    padding: 1.25rem 1.5rem;
    border: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.modern-table tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.modern-table tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.modern-table tbody tr {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.modern-table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    position: relative;
    z-index: 1;
}

/* Custom Checkboxes */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #CBD5E1;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.custom-checkbox:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Badges & Status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-email { background: #E0E7FF; color: #4338CA; }
.badge-sms { background: #DCFCE7; color: #15803D; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-sent .status-dot { background: #10B981; box-shadow: 0 0 8px #10B981; }
.status-draft .status-dot { background: #F59E0B; }

/* Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: none;
    font-weight: 500;
}

.alert.error {
    background: #FEF2F2;
    color: var(--danger);
    border: 1px solid #FEE2E2;
    display: block;
}

.alert.success {
    background: #ECFDF5;
    color: var(--secondary-hover);
    border: 1px solid #D1FAE5;
    display: block;
}

.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin { 
    100% { transform: rotate(360deg); } 
}
