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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0e14 0%, #161b26 50%, #0f1419 100%);
    background-size: 400% 400%;
    animation: liquidGradient 20s ease infinite;
    color: #e6edf3;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(31, 111, 235, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(63, 185, 80, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(88, 166, 255, 0.05) 0%, transparent 50%);
    animation: liquidMove 30s ease-in-out infinite;
    z-index: -1;
}

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

@keyframes liquidMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(60deg); }
    66% { transform: translate(-20px, 20px) rotate(-60deg); }
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(22, 27, 34, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #e6edf3;
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #e6edf3;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar h2 {
    margin-bottom: 30px;
    font-size: 22px;
    background: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #8b949e;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(88, 166, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #e6edf3;
    border-color: rgba(88, 166, 255, 0.2);
    transform: translateX(4px);
}

.sidebar-menu a.active {
    background: rgba(31, 111, 235, 0.15);
    backdrop-filter: blur(10px);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
    box-shadow:
        0 4px 12px rgba(31, 111, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
    margin-bottom: 15px;
    font-size: 13px;
    color: #8b949e;
}

.user-info strong {
    display: block;
    margin-bottom: 4px;
    color: #e6edf3;
    font-size: 14px;
}

.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.header {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px 32px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header h1 {
    color: #e6edf3;
    font-size: 32px;
    font-weight: 600;
}

.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #8b949e;
    padding: 8px 16px;
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.auto-refresh-indicator.active {
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.3);
    background: rgba(63, 185, 80, 0.05);
    box-shadow: 0 0 20px rgba(63, 185, 80, 0.1);
}

.auto-refresh-dot {
    width: 8px;
    height: 8px;
    background: #3fb950;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.5);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e6edf3;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(10px);
    color: #e6edf3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.date-picker {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(10px);
    color: #e6edf3;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.date-picker:focus {
    outline: none;
    border-color: rgba(88, 166, 255, 0.5);
    box-shadow:
        0 0 0 3px rgba(88, 166, 255, 0.1),
        0 0 20px rgba(88, 166, 255, 0.15);
}

.date-picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-group label input[type="checkbox"] {
    margin-right: 10px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(88, 166, 255, 0.5);
    box-shadow:
        0 0 0 3px rgba(88, 166, 255, 0.1),
        0 0 20px rgba(88, 166, 255, 0.15);
    background: rgba(13, 17, 23, 0.7);
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.form-inline .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-warning {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.8) 0%, rgba(26, 92, 215, 0.8) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(88, 166, 255, 0.3);
    box-shadow:
        0 4px 16px rgba(31, 111, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(31, 111, 235, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(88, 166, 255, 0.5);
}

.btn-secondary {
    background: rgba(48, 54, 61, 0.6);
    backdrop-filter: blur(10px);
    color: #e6edf3;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(66, 74, 83, 0.6);
    transform: translateY(-1px);
}

.modal-footer .btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger {
    background: linear-gradient(135deg, rgba(218, 54, 51, 0.8) 0%, rgba(192, 41, 45, 0.8) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(248, 81, 73, 0.3);
    box-shadow:
        0 4px 16px rgba(218, 54, 51, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(218, 54, 51, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, rgba(46, 160, 67, 0.8) 0%, rgba(35, 134, 54, 0.8) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(63, 185, 80, 0.3);
    box-shadow:
        0 4px 16px rgba(46, 160, 67, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(46, 160, 67, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-warning {
    background: linear-gradient(135deg, rgba(210, 153, 34, 0.8) 0%, rgba(184, 134, 11, 0.8) 100%);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(210, 153, 34, 0.3);
    box-shadow:
        0 4px 16px rgba(210, 153, 34, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(210, 153, 34, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Cards */
.card {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 28px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(88, 166, 255, 0.2);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card h2 {
    margin-bottom: 24px;
    color: #e6edf3;
    font-size: 20px;
    font-weight: 600;
}

.card h3 {
    margin-bottom: 16px;
    color: #8b949e;
    font-size: 16px;
    font-weight: 600;
}

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

.stat-card {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card:hover {
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(88, 166, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #e6edf3;
    text-shadow: 0 2px 10px rgba(230, 237, 243, 0.1);
}

.stat-value.positive {
    color: #3fb950;
    text-shadow: 0 2px 20px rgba(63, 185, 80, 0.3);
}

.stat-value.negative {
    color: #f85149;
    text-shadow: 0 2px 20px rgba(248, 81, 73, 0.3);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(13, 17, 23, 0.4);
    backdrop-filter: blur(10px);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

table th {
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(10px);
    font-weight: 600;
    color: #8b949e;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    color: #e6edf3;
}

table tr:hover {
    background: rgba(88, 166, 255, 0.05);
    backdrop-filter: blur(10px);
}

table .actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid;
}

.badge-success {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.3);
    box-shadow: 0 0 20px rgba(63, 185, 80, 0.1);
}

.badge-warning {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border-color: rgba(210, 153, 34, 0.3);
    box-shadow: 0 0 20px rgba(210, 153, 34, 0.1);
}

.badge-danger {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border-color: rgba(248, 81, 73, 0.3);
    box-shadow: 0 0 20px rgba(248, 81, 73, 0.1);
}

.badge-info {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-color: rgba(88, 166, 255, 0.3);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.1);
}

/* Messages */
.error,
.success,
.info {
    padding: 14px 18px;
    border-radius: 12px;
    margin-top: 16px;
    display: none;
    font-size: 14px;
    border: 1px solid;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.error.show,
.success.show,
.info.show {
    display: block;
}

.error {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border-color: rgba(248, 81, 73, 0.3);
}

.success {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.3);
}

.info {
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-color: rgba(88, 166, 255, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 9, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(22, 27, 34, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 32px;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
    margin: 0;
    color: #e6edf3;
    font-size: 22px;
}

.modal-close {
    background: rgba(48, 54, 61, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 28px;
    cursor: pointer;
    color: #8b949e;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(66, 74, 83, 0.6);
    color: #e6edf3;
    transform: rotate(90deg);
}

.modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Loading */
.loading {
    text-align: center;
    padding: 48px;
    color: #8b949e;
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: -1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px 8px 0 0;
}

.tab:hover {
    color: #e6edf3;
    background: rgba(88, 166, 255, 0.08);
}

.tab.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
    background: rgba(88, 166, 255, 0.05);
    box-shadow: 0 -2px 20px rgba(88, 166, 255, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Campaign Card */
.campaign-card {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.campaign-card:hover {
    border-color: rgba(88, 166, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(88, 166, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

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

.campaign-name {
    font-size: 17px;
    font-weight: 600;
    color: #e6edf3;
    margin-bottom: 8px;
}

.campaign-meta {
    font-size: 12px;
    color: #8b949e;
}

.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.campaign-stat {
    text-align: center;
}

.campaign-stat-label {
    font-size: 11px;
    color: #8b949e;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.campaign-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #e6edf3;
    text-shadow: 0 2px 10px rgba(230, 237, 243, 0.1);
}

.campaign-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Chart Container */
.chart-container {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 28px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #e6edf3;
    font-size: 18px;
    font-weight: 600;
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

/* Section */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

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

    .form-inline .form-group {
        margin-bottom: 20px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(13, 17, 23, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(88, 166, 255, 0.3);
    border-radius: 10px;
    border: 2px solid rgba(13, 17, 23, 0.4);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 166, 255, 0.5);
}

/* Smooth Transitions */
* {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
