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

:root {
    --bg: #0f0f23;
    --bg-card: #1a1a3e;
    --bg-input: #252550;
    --border: #2d2d6b;
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --accent: #764ba2;
    --green: #10b981;
    --red: #ef4444;
    --text: #ffffff;
    --text-dim: rgba(255,255,255,0.6);
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}
.login-logo { font-size: 3rem; margin-bottom: 12px; }
.login-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-card > p { color: var(--text-dim); margin-bottom: 32px; }
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: white;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    justify-content: center;
}
.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.login-hint {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Dashboard Header */
.dash-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.dash-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
}
.dash-logo-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dash-user {
    display: flex;
    align-items: center;
    gap: 16px;
}
.dash-user span { color: var(--text-dim); font-size: 0.9rem; }
.btn-logout {
    padding: 8px 20px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

/* Main */
.dash-main { padding: 40px 24px; }
.dash-container { max-width: 1100px; margin: 0 auto; }

/* Stats */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
}
.stat-card.stat-active { border-color: var(--green); }
.stat-card.stat-inactive { border-color: var(--red); }
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.stat-active .stat-number { color: var(--green); }
.stat-inactive .stat-number { color: var(--red); }
.stat-label { color: var(--text-dim); font-size: 0.9rem; }

/* Sections */
.dash-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
}
.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.dash-section-header h2 { font-size: 1.2rem; font-weight: 600; }

/* Form */
.create-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.form-group input {
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}
.form-group input::placeholder { color: rgba(255,255,255,0.3); }
.slug-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.slug-input-group:focus-within { border-color: var(--primary); }
.slug-prefix {
    padding: 14px 0 14px 16px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 1rem;
}
.slug-input-group input {
    border: none;
    background: transparent;
    padding-left: 4px;
}
.slug-input-group input:focus { outline: none; }
.btn-create {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-self: flex-start;
}
.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* Search */
.search-input {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    width: 260px;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-input::placeholder { color: rgba(255,255,255,0.3); }

/* Redirect Cards */
.redirects-list { display: flex; flex-direction: column; gap: 12px; }
.redirect-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s;
    gap: 16px;
    flex-wrap: wrap;
}
.redirect-card.active { border-left: 4px solid var(--green); }
.redirect-card.inactive { border-left: 4px solid var(--red); opacity: 0.7; }
.redirect-info { flex: 1; min-width: 200px; }
.redirect-slug {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.slug-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.slug-link:hover { text-decoration: underline; }
.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.btn-copy:hover { opacity: 1; }
.redirect-url {
    font-size: 0.85rem;
    color: var(--text-dim);
    word-break: break-all;
}
.redirect-date {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    margin-top: 4px;
}
.redirect-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Toggle */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--red);
    border-radius: 26px;
    transition: 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--green); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

.btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.btn-delete:hover { opacity: 1; }

/* Empty state */
.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--primary);
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.9rem;
    z-index: 9999;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .dash-stats { grid-template-columns: 1fr; }
    .dash-header-inner { flex-direction: column; gap: 12px; }
    .redirect-card { flex-direction: column; align-items: flex-start; }
    .search-input { width: 100%; }
    .login-card { padding: 32px 24px; }
}
