/* ============================================================
   SIVEN SHORTLINK - GLOBAL STYLESHEET
   ============================================================ */

:root {
    --bg: #f0f2f5;
    --bg-dark: #0f172a;
    --white: #ffffff;
    --text: #1a1d23;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #eef2ff;
    --green: #10b981;
    --green-light: #d1fae5;
    --red: #ef4444;
    --red-light: #fee2e2;
    --orange: #f59e0b;
    --orange-light: #fef3c7;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
    --sidebar-width: 250px;
    --header-height: 60px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== LAYOUT ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: #1a1d23;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 24px;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-brand .brand-icon {
    font-size: 1.5rem;
}

.sidebar-brand .brand-accent {
    color: #818cf8;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    padding: 0 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.sidebar-link.active {
    background: #4f46e5;
    color: white;
    font-weight: 600;
}

.sidebar-link .icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ========== TOP BAR ========== */
.top-bar {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 8px;
    padding: 8px 14px;
    gap: 8px;
    width: 300px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
}

.notif-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #4f46e5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: 24px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== CARDS ========== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== CARD BOX ========== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

/* ========== TABLE ========== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
}

table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

table tr:hover {
    background: #fafafa;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}

.btn-outline {
    background: white;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-success {
    background: var(--green);
    color: white;
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
    background: var(--white);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

/* ========== BADGE ========== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-success {
    background: var(--green-light);
    color: #065f46;
}

.badge-warning {
    background: var(--orange-light);
    color: #92400e;
}

.badge-danger {
    background: var(--red-light);
    color: #991b1b;
}

.badge-info {
    background: var(--accent-light);
    color: #3730a3;
}

/* ========== ALERT ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.alert-info {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--accent); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .hamburger-btn {
        display: block;
    }
    .search-box {
        display: none;
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 16px;
    }
}

/* ========== LANDING PAGE SPECIFIC ========== */
.landing-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.landing-hero {
    text-align: center;
    padding: 80px 24px;
    background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 100%);
    color: white;
}

.landing-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 12px;
}

.landing-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 24px;
}

.shorten-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.shorten-box input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    border-radius: 50px;
}

.shorten-box button {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
}

/* ========== PRICING CARDS ========== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s;
}

.pricing-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(79,70,229,0.1);
    transform: translateY(-4px);
}

.pricing-card.popular {
    border-color: var(--accent);
    border-width: 2px;
    position: relative;
}

.pricing-card .popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.pricing-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin: 12px 0;
}

.pricing-card .price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.pricing-card ul {
    list-style: none;
    text-align: left;
    margin: 16px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pricing-card ul li {
    padding: 4px 0;
}

.pricing-card ul li::before {
    content: '✓ ';
    color: var(--green);
    font-weight: 700;
}