* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    background: white;
    border-radius: 16px;
    padding: 30px 40px;
    margin-bottom: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 5px;
}

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

.header-right {
    text-align: right;
}

.stats-mini {
    display: flex;
    gap: 20px;
}

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

.stat-mini-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.stat-mini-label {
    font-size: 12px;
    color: #999;
}

.main-content {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
}

.generator-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.table-panel {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-height: 400px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.example-box {
    background: #f0f7ff;
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 15px 0 25px 0;
    border-radius: 6px;
}

.example-box strong {
    color: #667eea;
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.example-item {
    margin: 8px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.example-item code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

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

.form-group-full {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 13px;
}

.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

input[type="text"],
textarea,
select {
    padding: 11px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    line-height: 1.4;
}

.btn {
    padding: 13px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
}

.btn-success {
    background: #28a745;
}

.btn-danger {
    background: #dc3545;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-small {
    padding: 7px 16px;
    font-size: 13px;
}

.table-container {
    overflow-x: auto;
    max-height: 550px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

th input[type="checkbox"] {
    cursor: pointer;
}

tr:hover {
    background: #f8f9fa;
}

tr.selected {
    background: #e7f3ff;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.created {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.link-cell {
    font-family: monospace;
    font-size: 12px;
    color: #333;
    word-break: break-all;
    line-height: 1.5;
    max-width: 400px;
}

.short-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-family: monospace;
    font-size: 12px;
}

.short-link:hover {
    text-decoration: underline;
}

.action-btn {
    padding: 5px 12px;
    font-size: 12px;
    margin-right: 4px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.selection-info {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.bitly-panel {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #ffc107;
}

.bitly-panel h4 {
    margin-bottom: 12px;
    color: #333;
    font-size: 16px;
}

.note-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.note-input:focus {
    outline: none;
    border-color: #667eea;
}

input[type="file"] {
    display: none;
}

.batch-indicator {
    background: #f0f7ff;
    border: 2px dashed #667eea;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #667eea;
    text-align: center;
    font-weight: 600;
}

.duplicate-warning {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #856404;
}

.link-mode-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.link-mode-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.link-mode-toggle input:checked+.toggle-slider {
    background-color: #667eea;
}

.link-mode-toggle input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

.mode-label {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
    font-weight: 600;
}

.mode-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}