* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Messages */
.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.error-box {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-box.stat-error {
    border-left: 4px solid #f44336;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 968px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}

.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panel */
.panel {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.panel h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.panel h3 {
    font-size: 14px;
    margin: 20px 0 10px 0;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    font-family: inherit;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.inline-form input {
    flex: 1;
}

/* Buttons */
button, .btn-primary, .btn-secondary, .btn-small, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary, button[type="submit"] {
    background: #667eea;
    color: white;
}

.btn-primary:hover, button[type="submit"]:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

table tbody tr:hover {
    background: #f8f9fa;
}

td.actions {
    white-space: nowrap;
}

td.actions form {
    margin: 0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-primary {
    background: #cfe2ff;
    color: #084298;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #dee2e6;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tag small {
    color: #6c757d;
}

.tag-remove {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 16px;
    height: 16px;
}

.tag-remove:hover {
    color: #c82333;
}

/* Logs */
.log-list {
    max-height: 600px;
    overflow-y: auto;
}

.log-item {
    padding: 12px;
    border-left: 3px solid #ddd;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.log-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.log-time {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
}

.log-details {
    font-size: 13px;
    margin-bottom: 5px;
    color: #555;
}

.log-message {
    font-size: 13px;
    color: #333;
    margin-top: 5px;
}

.log-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    padding: 5px;
    background: #f8d7da;
    border-radius: 3px;
}

/* Info Box */
.info-box {
    background: #d1ecf1;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #0c5460;
    margin-top: 15px;
    font-size: 14px;
    color: #0c5460;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 14px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 15px;
}

.modal-content input {
    margin-bottom: 15px;
}

.modal-content button {
    margin-right: 10px;
}