/* Modern minimalistic CRM styles */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.sidebar-title {
    font-weight: 600;
    color: #e5e7eb;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #9ca3af;
    display: block;
}

.nav-link:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #e5e7eb;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.25));
    color: #f9fafb;
}

.nav-link-secondary {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.sidebar-user {
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    padding: 1.25rem 1.75rem 0.75rem;
}

.page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.content {
    padding: 0 1.75rem 1.75rem;
}

.footer {
    margin-top: auto;
    padding: 0.75rem 1.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.8rem;
    color: #6b7280;
}

.card {
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.95));
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.85rem;
    color: #9ca3af;
}

.badge {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.badge-success {
    border-color: rgba(34, 197, 94, 0.6);
    color: #bbf7d0;
    background: rgba(21, 128, 61, 0.25);
}

.badge-warning {
    border-color: rgba(234, 179, 8, 0.6);
    color: #fef9c3;
    background: rgba(161, 98, 7, 0.25);
}

.badge-muted {
    color: #9ca3af;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.9rem;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.input,
.select {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.4rem 0.75rem;
    color: #e5e7eb;
    font-size: 0.9rem;
    outline: none;
    min-width: 0;
}

.input:focus,
.select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.btn {
    border-radius: 999px;
    border: none;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: #020617;
    font-weight: 500;
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.btn-ghost {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.15);
}

.btn-full {
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.55rem 0.45rem;
    text-align: left;
}

.table th {
    font-weight: 500;
    color: #9ca3af;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.table tr:nth-child(even) td {
    background: rgba(15, 23, 42, 0.65);
}

.table tr:nth-child(odd) td {
    background: rgba(15, 23, 42, 0.8);
}

.table tr:hover td {
    background: rgba(30, 64, 175, 0.45);
}

.table-actions {
    display: flex;
    gap: 0.25rem;
}

.pill {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    font-size: 0.75rem;
    color: #9ca3af;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 0.25rem;
}

.status-planned {
    background: #38bdf8;
}

.status-in_progress {
    background: #22c55e;
}

.status-completed {
    background: #a5b4fc;
}

.status-on_hold {
    background: #f97316;
}

.form {
    display: grid;
    gap: 0.6rem;
}

.form-row {
    display: grid;
    gap: 0.5rem;
}

.form-row-2 {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.form-label {
    font-size: 0.85rem;
    color: #9ca3af;
    display: grid;
    gap: 0.25rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.task-row-completed td {
    opacity: 0.6;
}

.task-name-completed {
    text-decoration: line-through;
}

.inline-form {
    display: inline;
}

.alert {
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.alert-info {
    background: rgba(96, 165, 250, 0.15);
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.4);
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #1d2538 0, #020617 55%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-card {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 1.25rem;
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 1);
}

.app-title {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}

.auth-subtitle {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

.muted {
    color: #9ca3af;
    font-size: 0.85rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.chip {
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #9ca3af;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.flex {
    display: flex;
}

.flex-between {
    justify-content: space-between;
}

.flex-gap {
    gap: 0.5rem;
}

.nowrap {
    white-space: nowrap;
}

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: #9ca3af;
}

.text-success {
    color: #4ade80;
}

.text-danger {
    color: #fca5a5;
}

.text-warning {
    color: #facc15;
}

@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-footer {
        align-items: flex-end;
    }
}

