:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.8);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    background-image:
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    font-weight: 500;
    color: var(--text-main);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.23);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    background: var(--border);
    color: var(--text-main);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: var(--surface);
    backdrop-filter: blur(8px);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

.view-tabs {
    display: flex;
    gap: 8px;
    background: var(--border);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Subscription Cards */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.subscription-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.subscription-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.25rem;
}

.service-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-top: 12px;
}

.service-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-safe {
    background: #d1fae5;
    color: #065f46;
}

.status-notice {
    background: #fef9c3;
    color: #854d0e;
}

.status-warning {
    background: #ffedd5;
    color: #9a3412;
}

.status-urgent {
    background: #fee2e2;
    color: #991b1b;
}

.status-critical {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.status-expired {
    background: #f1f5f9;
    color: #475569;
}

.card-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.detail-item .value {
    font-weight: 600;
    font-size: 0.95rem;
}

.card-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    position: relative;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    animation: modalIn 0.3s ease-out;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--background);
}

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

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.quick-dates {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quick-date-btn,
.renew-duration-btn {
    flex: 1;
    min-width: 70px;
    padding: 6px;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-date-btn:hover,
.renew-duration-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    margin-top: 100px;
    color: var(--text-muted);
}

.empty-state h3 {
    margin-top: 20px;
    font-size: 1.5rem;
    color: var(--text-main);
}

/* Login Page specifically */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 2px solid var(--border);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    display: inline-flex;
    margin-bottom: 16px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-tabs {
        overflow-x: auto;
    }
}