:root {
    --primary: #7bcfad;
    --secondary: #ffecd0;
    --dark: #52796f;
    --text: #333;
    --white: #fff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

* {
    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, var(--secondary) 0%, var(--primary) 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    box-shadow: 4px 0 20px var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    background: var(--secondary);
    border-left-color: var(--primary);
    color: var(--dark);
}

.sidebar-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    border-left-color: var(--primary);
    color: var(--white);
}

.sidebar-icon {
    font-size: 1.5rem;
    width: 2rem;
    text-align: center;
}

.sidebar-section {
    margin: 0;
}

.sidebar-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    user-select: none;
}

.sidebar-section-header:hover {
    background: var(--secondary);
    border-left-color: var(--primary);
}

.sidebar-toggle {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.sidebar-section-items {
    display: block;
    transition: all 0.3s;
}

.sidebar-sublink {
    padding-left: 3rem;
    font-size: 0.95rem;
}

.sidebar-sublink .sidebar-icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.sidebar-logout {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.sidebar-logout:hover {
    color: var(--dark);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 0;
    width: calc(100% - 280px);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px var(--shadow-lg);
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--text);
    color: var(--white);
}

.btn-warning {
    background: #f0ad4e;
    color: var(--white);
}

.btn-info {
    background: var(--primary);
    color: var(--white);
}

.btn-danger {
    background: #e74c3c;
    color: var(--white);
}

.btn-success {
    background: #28a745;
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-view {
    background: #3b82f6;
    color: white;
}

.btn-view:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--secondary);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(123, 207, 173, 0.1);
}

.form-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
    display: block;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check-label {
    font-weight: 500;
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: rgba(123, 207, 173, 0.15);
    border-left: 4px solid var(--primary);
    color: var(--dark);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.15);
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.alert-info {
    background: rgba(123, 207, 173, 0.1);
    border-left: 4px solid var(--dark);
    color: var(--dark);
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.btn-close:hover {
    opacity: 1;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

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

.table thead {
    background: var(--dark);
    color: var(--white);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.table thead th:last-child {
    border-radius: 0 12px 0 0;
}

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

.table tbody tr {
    background: var(--white);
    transition: background 0.3s;
}

.table tbody tr:hover {
    background: var(--secondary);
}

.table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

.table tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

.table td .btn {
    margin-right: 0.5rem;
}

/* Welcome/Home page */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 2rem;
}

.info-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 16px;
    margin-top: 2rem;
}

.info-box p {
    margin-bottom: 1rem;
}

/* Form layout */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Action buttons group */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Button hover effects */
.btn-warning:hover,
.btn-info:hover,
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-lg);
}

/* Table hover animation */
.table tbody tr {
    transition: all 0.2s ease;
}

/* Form input animations */
.form-control {
    transition: all 0.3s ease;
}

.form-control:hover {
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
        width: calc(100% - 240px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-header {
        padding: 1.5rem;
    }

    .sidebar-brand {
        font-size: 1.25rem;
    }

    .sidebar-footer {
        padding: 1rem 1.5rem;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .container {
        padding: 0 1rem;
        margin: 2rem auto;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .table {
        font-size: 0.875rem;
    }

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

    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

/* Table Links Styling */
.table tbody a {
    color: #000;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s;
}

.table tbody a:hover {
    color: #333;
    text-decoration: underline;
}

/* Action buttons styling */
.action-buttons .btn {
    color: white !important;
    text-decoration: none !important;
}

/* Badge Styling */
.badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.875em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Form row for multiple inputs on same line */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Form actions (buttons at bottom of forms) */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}
