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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 15px;
    color: #667eea;
}

nav {
    display: flex;
    gap: 15px;
}

nav a {
    padding: 8px 16px;
    text-decoration: none;
    color: #666;
    border-radius: 4px;
    transition: background 0.2s;
}

nav a:hover {
    background: #f0f0f0;
}

nav a.active {
    background: #667eea;
    color: white;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

section {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

section h2 {
    margin-bottom: 20px;
    color: #333;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.link-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.link-info strong {
    font-size: 16px;
    color: #333;
}

.link-url {
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

.link-group {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
    margin-top: 4px;
}

.link-id {
    font-size: 11px;
    color: #999;
    font-family: monospace;
    margin-top: 4px;
    display: block;
}

.form-group small {
    display: block;
    margin-top: 4px;
}

.form-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

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

/* Login Page Styles */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-container header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.login-container header h1 {
    margin-bottom: 8px;
}

.login-container header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.error-message {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.logout-link {
    margin-left: auto;
    padding: 8px 16px;
    background: #f44336;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.logout-link:hover {
    background: #da190b;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: background 0.2s;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-edit {
    background: #4caf50;
    color: white;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-delete {
    background: #f44336;
    color: white;
}

.btn-delete:hover {
    background: #da190b;
}

.form-section {
    max-width: 600px;
}

.link-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
}

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

.form-actions {
    display: flex;
    gap: 12px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.stats-table th,
.stats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.stats-table th {
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
}

.stats-table tr:hover {
    background: #f9f9f9;
}

@media (max-width: 768px) {
    .link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .link-actions {
        width: 100%;
    }

    .stats-table {
        font-size: 14px;
    }

    .stats-table th,
    .stats-table td {
        padding: 8px;
    }
}

