/* Modern Design System */
:root {
    /* Colors */
    --primary: #3B82F6; /* Blue-500 */
    --primary-hover: #2563EB; /* Blue-600 */
    --secondary: #6B7280; /* Gray-500 */
    --success: #10B981; /* Emerald-500 */
    --danger: #EF4444; /* Red-500 */
    --warning: #F59E0B; /* Amber-500 */
    --info: #3B82F6;
    
    /* Backgrounds */
    --bg-body: #F3F4F6; /* Gray-100 */
    --bg-card: #FFFFFF;
    --bg-input: #F9FAFB;
    
    /* Text */
    --text-main: #111827; /* Gray-900 */
    --text-muted: #6B7280; /* Gray-500 */
    --text-light: #9CA3AF; /* Gray-400 */
    --text-white: #FFFFFF;
    
    /* Borders */
    --border-color: #E5E7EB; /* Gray-200 */
    --border-focus: #3B82F6;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacing */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Font */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color 0.15s;
}

a:hover {
    color: var(--primary-hover);
}

ul {
    list-style: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Navbar */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-badge {
    font-size: 0.65rem;
    background-color: #DBEAFE;
    color: var(--primary);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-weight: 600;
    vertical-align: super;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link i {
    font-size: 1rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Auth Buttons in Nav */
.btn-nav-outline {
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-nav-outline:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.25rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.875rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; color: var(--text-muted); }

.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

/* Components: Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card.centered {
    max-width: 28rem;
    margin: 2rem auto;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.card-body {
    padding: 1.5rem;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #fff;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.4rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
}

.btn-block {
    display: flex;
    width: 100%;
}

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

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

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
}

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

.btn-danger:hover {
    background-color: #DC2626; /* Red-600 */
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background-color: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background-color: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background-color: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background-color: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-blue { background: #EFF6FF; color: var(--primary); }
.icon-green { background: #ECFDF5; color: var(--success); }
.icon-purple { background: #F5F3FF; color: #7C3AED; }
.icon-orange { background: #FFF7ED; color: var(--warning); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.stat-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.table th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.table tr:last-child td {
    border-bottom: none;
}

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

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* Grid of Tools */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-card-body {
    padding: 1.5rem;
    flex: 1;
}

.tool-icon {
    width: 3rem;
    height: 3rem;
    background: #EFF6FF;
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tool-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.tool-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tool-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #F9FAFB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

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

/* Footer */
.footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-link:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 60;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Nav Menu Container */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: space-between;
    margin-left: 2rem;
}

/* Responsive */
@media (max-width: 968px) {
    /* Show mobile toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide nav menu by default on mobile */
    .nav-menu {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 1rem 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 80vh;
        opacity: 1;
        overflow-y: auto;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .nav-link {
        width: 100%;
        padding: 0.875rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:hover {
        background-color: var(--bg-body);
    }
    
    .nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-actions .nav-link,
    .nav-actions .btn-nav-outline {
        width: 100%;
        padding: 0.875rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        text-align: left;
        justify-content: flex-start;
    }
    
    .nav-actions .btn {
        width: calc(100% - 3rem);
        margin: 0.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        height: 4rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}