/* ============================================
   KASTON.COM - MAIN STYLESHEET
   Last Updated: 2025-05-21
   ============================================ */

/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    /* Color System */
    --primary-color: #6B46C1;    /* Purple */
    --primary-dark: #553C9A;     /* Darker purple for hover */
    --primary-light: #9F7AEA;    /* Light purple for accents */
    --secondary-color: #4a6cf7;   /* Blue for secondary actions */
    
    /* Text Colors */
    --text-light: #FFFFFF;
    --text-dark: #2D3748;
    --text-muted: #4A5568;
    
    /* Background Colors */
    --background-light: #F7FAFC;
    --white: #FFFFFF;
    
    /* Gray Scale */
    --gray-50: #F8FAFC;
    --gray-100: #F7FAFC;
    --gray-200: #EDF2F7;
    --gray-300: #E2E8F0;
    --gray-400: #CBD5E0;
    --gray-500: #A0AEC0;
    --gray-600: #718096;
    --gray-700: #4A5568;
    --gray-800: #2D3748;
    --gray-900: #1A202C;
    
    /* Status Colors */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-md);
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    background-color: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-dark);
}

/* Checkboxes and Radios */
input[type="checkbox"],
input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: var(--space-sm);
    vertical-align: middle;
}

/* ============================================
   BUTTONS
   ============================================ */
.button,
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Button Variants */
.button--primary,
.button--primary:visited {
    background-color: var(--primary-color);
    color: var(--white);
}

.button--primary:hover,
.button--primary:focus {
    background-color: var(--primary-dark);
    color: var(--white);
}

.button--secondary,
.button--secondary:visited {
    background-color: var(--secondary-color);
    color: var(--white);
}

.button--secondary:hover,
.button--secondary:focus {
    background-color: #3a56d4;
    color: var(--white);
}

.button--outline {
    background-color: transparent;
    border: 1px solid var(--gray-300);
    color: var(--text-dark);
}

.button--outline:hover,
.button--outline:focus {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
}

/* Button Sizes */
.button--sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.button--lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Button with Icon */
.button--with-icon {
    gap: 0.5rem;
}

.button--with-icon .icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

/* ============================================
   LAYOUT & CONTAINERS
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.section {
    padding: var(--space-2xl) 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card__header,
.card__body,
.card__footer {
    padding: var(--space-md);
}

.card__header {
    border-bottom: 1px solid var(--gray-200);
}

.card__footer {
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.alert--success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert--error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert--warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert--info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* ============================================
   UTILITIES
   ============================================ */
/* Flex Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Spacing Utilities */
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

/* Text Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.text-muted { color: var(--text-muted); }

/* Display Utilities */
.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-md);
    background-color: var(--gray-100);
}

.login-container {
    width: 100%;
    max-width: 28rem;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2xl);
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-header h1 {
    margin: var(--space-md) 0 0;
}

.login-logo {
    height: 3.5rem;
    width: auto;
}

/* Remember Me Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
}

.remember-me input[type="checkbox"] {
    margin-right: var(--space-sm);
}

.remember-me input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn var(--transition-normal);
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    box-sizing: border-box;
}

.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    margin: 0;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: slideIn var(--transition-normal);
    overflow-y: auto;
}

.modal-title {
    color: var(--primary-color);
    margin: 0 0 var(--space-md) 0;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-dark);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (min-width: 640px) {
    .modal-content {
        padding: var(--space-xl);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}

header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 0.5rem 2rem;
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 52px;
}

.logo-container {
    flex: 0 0 auto;
}

.logo {
    max-height: 32px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.auth-container {
    flex: 0 0 auto;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 0.5rem 1rem;
    background-color: var(--danger-color);
    color: white;
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.logout-button:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.login-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.landing-content {
    padding-top: 80px; /* Account for fixed header */
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    padding: 6rem 2rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 4rem;
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
}

.welcome-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tagline {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
    user-select: none;
}

/* Button Variants */
.btn--primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn--primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn--secondary {
    background-color: var(--gray-200);
    color: var(--gray-800);
    border-color: var(--gray-300);
}

.btn--secondary:hover {
    background-color: var(--gray-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn--danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .btn--block-mobile {
        width: 100%;
    }
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    margin: 1rem;
}

.login-container h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.8rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--secondary-color);
}

.form-group small {
    display: block;
    margin-top: 0.75rem;
    color: var(--gray-600);
    font-size: 0.85rem;
    line-height: 1.4;
}

.password-requirements {
    list-style: none;
    padding: 0.5rem 0 0 1.2rem;
    margin: 0;
}

.password-requirements li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.3rem;
}

.password-requirements li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-wrapper input:focus + .input-icon,
.input-wrapper select:focus + .input-icon {
    color: var(--secondary-color);
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: var(--dark-gray);
    opacity: 0.7;
}

.form-group select {
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%237f8c8d' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

.form-group .input-icon {
    position: absolute;
    right: 1rem;
    top: 2.75rem;
    color: var(--dark-gray);
    transition: all 0.3s ease;
}

.form-group input:focus + .input-icon {
    color: var(--secondary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

.form-actions button {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-actions button i {
    font-size: 1.1rem;
}

.form-actions .submit-button {
    background: var(--success-color);
    color: var(--white);
}

.form-actions .submit-button:hover {
    background: #219a52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.form-actions .cancel-button {
    background: var(--light-gray);
    color: var(--primary-color);
}

.form-actions .cancel-button:hover {
    background: #bdc3c7;
    transform: translateY(-1px);
}

.login-submit {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 0.875rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.error-message {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #DC2626;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

/* Dashboard Styles */
.nav-links {
    display: flex;
    gap: 0.4rem;
    margin: 0;
    flex: 1;
    align-items: flex-end;
    height: 100%;
}

/* Navigation Links - Consolidated */
.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

/* Tab Navigation Link */
.nav-link--tab {
    padding: 0.4rem 0.8rem;
    color: var(--text-light);
    border-radius: 6px 6px 0 0;
    background: rgba(255, 255, 255, 0.1);
    min-width: 80px;
    height: 32px;
    margin-bottom: -0.5rem;
    justify-content: center;
}

.nav-link--tab:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.nav-link--tab.active {
    background: white;
    border: 1px solid var(--gray-200);
    border-bottom-color: white;
    color: var(--primary-color);
    font-weight: 500;
}

/* Simple Navigation Link */
.nav-link-simple {
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link-simple:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

/* Tab Navigation Link */
.nav-link-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 80px;
    height: 32px;
    margin-bottom: -0.5rem;
}

.nav-link-tab:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.nav-text {
    line-height: 1.2;
    max-width: 100%;
    display: block;
    overflow-wrap: break-word;
    padding: 0 0.2rem;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    border-color: var(--gray-200);
}

.nav-container {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex: 1;
    background: var(--primary-color);
    height: 100%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: auto;
    padding: 0.5rem 0 0.5rem 1.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 320px;
    max-width: 400px;
}

.user-email {
    color: var(--text-light);
    opacity: 0.9;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 180px;
    max-width: 250px;
    flex: 1;
}

.logout-button:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.action-button {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.action-button:last-child {
    margin-right: 0;
}

.action-button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-button.warning {
    background-color: var(--warning-color);
}

.action-button.warning:hover {
    background-color: #e67e22;
}

.action-button.delete {
    background-color: #dc3545;
    border-color: #dc3545;
}

.action-button.delete:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.action-button.permissions {
    background-color: #6f42c1;
    border-color: #6f42c1;
    text-decoration: none;
}

.action-button.permissions:hover {
    background-color: #5a32a3;
    border-color: #543098;
}

.action-button.danger {
    background-color: var(--danger-color);
}

.action-button.danger:hover {
    background-color: #c0392b;
}

.actions-cell {
    white-space: nowrap;
    text-align: right;
}

.dashboard-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 80px auto 0;
}

.welcome-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--text-light);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-banner h1 {
    margin: 0;
    font-size: 2rem;
}

.role-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.module-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.module-card h2 {
    color: var(--primary-dark);
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.module-card p {
    color: var(--text-dark);
    opacity: 0.8;
    margin: 0 0 1.5rem 0;
    font-size: 0.875rem;
}

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

.permission-badge {
    background: var(--gray-100);
    color: var(--text-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.module-link {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.module-link:hover {
    background: var(--primary-dark);
}

.no-modules {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: var(--gray-100);
    border-radius: 12px;
    color: var(--text-dark);
}

.no-modules p {
    margin: 0 0 1rem 0;
    opacity: 0.8;
}

.no-modules p:last-child {
    margin-bottom: 0;
}

/* Breadcrumb Styles */
.breadcrumb {
    background: var(--gray-50);
    padding: 0.75rem 2rem;
    margin-top: 80px;
    border-bottom: 1px solid var(--gray-200);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: var(--gray-400);
    margin: 0 0.5rem;
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 500;
}

/* Module Permissions Page */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.user-info {
    text-align: right;
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.permissions-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    margin: 1.5rem 0;
}

.module-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.module-card:hover {
    box-shadow: var(--shadow-md);
}

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

.module-name {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-dark);
}

.module-description {
    color: var(--text-dark);
    opacity: 0.7;
    font-size: 0.9em;
    margin-bottom: 1rem;
}

.permission-select {
    width: 140px;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    background-color: white;
}

.permission-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(107, 70, 193, 0.2);
    outline: none;
}

.permission-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--gray-50);
}

.permission-select.permission-readonly {
    border-color: var(--info-color);
    color: var(--info-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.permission-select.permission-user {
    border-color: var(--success-color);
    color: var(--success-color);
    background-color: rgba(39, 174, 96, 0.1);
}

.permission-select.permission-admin {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background-color: rgba(231, 76, 60, 0.1);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: .4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Navigation Base Styles */
.top-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    z-index: 100;
}

.hamburger {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger:before,
.hamburger:after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: white;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger:before { top: -8px; }
.hamburger:after { bottom: -8px; }

/* Module Navigation */
.module-nav {
    background: var(--primary-color);
    padding: 0.5rem 2rem 0;
    border-bottom: 1px solid var(--primary-dark);
    box-shadow: 0 2px 4px rgba(107, 70, 193, 0.2);
    border-radius: 12px 12px 0 0;
}

.module-nav-links {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu-toggle {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-container {
        display: none;
        position: fixed;
        top: 60px;
        right: 0;
        bottom: 0;
        width: 160px;
        background: var(--primary-color);
        padding: 0.75rem;
        box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1000;
    }

    .module-nav-links {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }

    .nav-container.active {
        display: block;
    }

    .module-nav {
        padding: 0;
        border: none;
        box-shadow: none;
        border-radius: 0;
        margin-top: 1rem;
    }

    .module-nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-link-tab {
        width: auto;
        min-width: 100px;
        max-width: 140px;
        border-radius: 4px;
        text-align: right;
        padding: 0.75rem;
        font-size: 16px;
    }

    .nav-link-text {
        text-align: right;
        white-space: normal;
    }

    .user-menu {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--primary-dark);
        text-align: right;
    }

    .user-email {
        display: none;
    }

    .logout-button {
        display: inline-block;
        padding: 0.5rem 1rem;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        text-decoration: none;
        font-size: 16px;
    }

    /* Hamburger animation */
    .hamburger.active {
        background: transparent;
    }

    .hamburger.active:before {
        transform: rotate(45deg);
        top: 0;
    }

    .hamburger.active:after {
        transform: rotate(-45deg);
        bottom: 0;
    }

}

@media (max-width: 480px) {
    .module-nav {
        padding: 0.5rem 0.5rem 0;
    }

    .nav-link-tab {
        width: 70px;
        min-height: 30px;
        font-size: 0.8rem;
    }

    .nav-links {
        margin: 0 0.5rem;
    }
}



.nav-link.readonly {
    color: var(--info-color);
}

.nav-link.user {
    color: var(--success-color);
}

.nav-link.admin {
    color: var(--danger-color);
}

.role-badge {
    font-size: 0.7em;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.role-badge.admin {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}




/* Active state handled in nav-link--tab */

/* Responsive Design */
@media (max-width: 768px) {
    .top-nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        height: 40px;
    }

    .nav-links {
        margin: 0;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .welcome-content h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .hero-section {
        padding: 4rem 1rem;
    }

    .welcome-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .welcome-banner h1 {
        font-size: 1.75rem;
    }

    .dashboard-content {
        padding: 1rem;
        margin-top: 120px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        padding: 1.25rem;
    }
}
