/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f7fafc;
    color: #2d3748;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.nav-brand svg {
    color: #667eea;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f7fafc;
    color: #667eea;
}

.nav-link.active {
    background: #edf2f7;
    color: #667eea;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-weight: 500;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-logout:hover {
    background: #fed7d7;
    color: #e53e3e;
    border-color: #feb2b2;
}

/* Main Content */
.main-content {
    padding: 32px 24px;
}

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

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

.page-header p {
    color: #718096;
    font-size: 16px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* Card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
}

.card-body {
    padding: 24px;
}

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

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

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #718096;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group svg {
    position: absolute;
    left: 16px;
    color: #a0aec0;
}

.input-group input {
    width: 100%;
    padding: 12px 16px 12px 52px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-icon {
    padding: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #718096;
}

.btn-icon:hover {
    background: #f7fafc;
    color: #667eea;
    border-color: #cbd5e0;
}

.btn-danger:hover {
    background: #fed7d7;
    color: #e53e3e;
    border-color: #feb2b2;
}

/* Alert */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.link-item:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-short {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.link-short code {
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
}

.link-original {
    font-size: 13px;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-stats {
    margin-left: 16px;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    background: #edf2f7;
    color: #2d3748;
    font-size: 13px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state svg {
    color: #cbd5e0;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.empty-state p {
    color: #718096;
    margin-bottom: 24px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

.table thead {
    background: #f7fafc;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
    background: #f7fafc;
}

.code-cell code {
    background: #edf2f7;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
}

.url-cell a {
    color: #4a5568;
    text-decoration: none;
    display: block;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-cell a:hover {
    color: #667eea;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.text-muted {
    color: #718096;
    font-size: 13px;
}

/* Short URL Result */
.short-url-result {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.short-url-result input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.short-url-result button {
    white-space: nowrap;
}

.mt-3 {
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 16px;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        margin-top: 16px;
        flex-direction: column;
    }

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

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

    .action-buttons {
        flex-direction: column;
    }

    .table {
        font-size: 13px;
    }

    .url-cell a {
        max-width: 200px;
    }
}
