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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a1a;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    color: #1a1a1a;
}

p {
    margin-bottom: 16px;
}

.subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* Headers */
header {
    text-align: center;
    margin-bottom: 32px;
}

/* Wrappers */
.form-wrapper,
.summary-wrapper,
.admin-wrapper {
    background: white;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.login-wrapper {
    max-width: 400px;
}

/* Forms */
.form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.1);
}

.form-control.error {
    border-color: #dc3545;
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Error Messages */
.error-message {
    display: block;
    font-size: 12px;
    color: #dc3545;
    margin-top: 4px;
}

.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.alert ul {
    margin-left: 20px;
    margin-top: 8px;
}

.alert li {
    margin-bottom: 4px;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-primary:hover {
    background-color: #1a1a1a;
}

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

.btn-secondary:hover {
    background-color: #d8d8d8;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 8px 12px;
    font-size: 13px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.form-actions .btn {
    flex: 1;
}

/* Form Footer */
.form-footer,
.summary-footer,
.admin-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #eee;
    margin-top: 24px;
}

.link {
    display: inline-block;
    color: #333;
    text-decoration: underline;
    font-size: 14px;
    margin-left: 16px;
    transition: color 0.2s;
}

.link:hover {
    color: #666;
}

/* Summary Styles */
.summary-grid {
    display: grid;
    gap: 24px;
}

.summary-card {
    padding: 24px;
    background-color: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}

.summary-card.total {
    background-color: #333;
    color: white;
}

.card-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.summary-card.total .card-label {
    color: #bbb;
}

.card-value {
    font-size: 42px;
    font-weight: 600;
}

.summary-section {
    margin-top: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-card {
    padding: 16px;
    background-color: #f5f5f5;
    border-radius: 6px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

/* Admin Styles */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.admin-header h1 {
    margin-bottom: 0;
}

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

.admin-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.stat-box {
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 6px;
    text-align: center;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-number {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table thead {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.admin-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.admin-table tbody tr:hover {
    background-color: #f9f9f9;
}

.action-column {
    display: flex;
    gap: 6px;
    align-items: center;
}

.inline-form {
    display: inline;
}

.inline-form .btn {
    margin: 0;
}

.text-center {
    text-align: center;
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    font-size: 14px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .pagination-info {
    display: none;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .form-wrapper,
    .summary-wrapper,
    .admin-wrapper {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 16px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 24px;
    }

    .card-value {
        font-size: 36px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .admin-header h1 {
        margin-bottom: 0;
        width: 100%;
    }

    .header-actions {
        width: 100%;
    }

    .admin-table {
        font-size: 12px;
    }

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

    .action-column {
        flex-wrap: wrap;
    }

    .btn-small {
        padding: 6px 8px;
        font-size: 12px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .link {
        display: block;
        margin-left: 0;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .form-wrapper,
    .summary-wrapper,
    .admin-wrapper {
        padding: 16px;
        border-radius: 6px;
    }

    h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-control {
        padding: 10px;
        font-size: 16px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .card-value {
        font-size: 28px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-number {
        font-size: 28px;
    }

    .form-footer,
    .summary-footer,
    .admin-footer {
        padding-top: 16px;
    }
}
