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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f6f7;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 40px 20px;
    background: #f5f6f7;
}

/* Navbar */
nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

nav .nav-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

nav .nav-links a:hover {
    color: #212529;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #f5f6f7 0%, #eaeaeb 100%);
    padding: 40px 20px;
    border-bottom: 1px solid #e2e3e5;
    margin-bottom: 0;
}

.page-header .header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 28px;
    color: #212529;
    margin-bottom: 8px;
}

.page-header p {
    color: #666;
    font-size: 15px;
}

/* Login Styles */
.login-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 50px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    animation: slideIn 0.3s ease-out;
}

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

.login-content h1 {
    font-size: 28px;
    color: #212529;
    margin-bottom: 15px;
}

.login-content p {
    color: #666;
    margin-bottom: 8px;
    font-size: 15px;
}

.login-subtitle {
    color: #999 !important;
    font-size: 13px !important;
    margin-bottom: 25px !important;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    color: #212529;
    margin: 0;
}

.card-badge {
    background: #212529;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.card-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
}

.profile-info h3 {
    font-size: 18px;
    color: #212529;
    margin: 0 0 5px 0;
}

.profile-info p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.groups-list {
    list-style: none;
}

.groups-list li {
    padding: 12px 0;
    color: #212529;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.groups-list li:last-child {
    border-bottom: none;
}

.group-icon {
    font-size: 12px;
    opacity: 0.6;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.empty-state p {
    margin: 0 0 5px 0;
    font-size: 15px;
    color: #666;
}

.empty-state small {
    display: block;
    font-size: 12px;
    color: #999;
}

.logout-section {
    text-align: center;
    margin-top: 40px;
}

/* Buttons */
.btn-large {
    padding: 14px 40px !important;
    font-size: 16px !important;
}

.btn-primary {
    display: inline-block;
    background: #212529;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: #373d42;
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-logout {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-logout:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-delete:hover {
    background: #c82333;
}

/* SSH Keys Management */
.ssh-container {
    max-width: 1200px;
    margin: 0 auto;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.alert-icon {
    font-weight: bold;
    font-size: 16px;
}

.ssh-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 968px) {
    .ssh-grid {
        grid-template-columns: 1fr;
    }
}

.ssh-form-card,
.ssh-list-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.ssh-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #212529;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

.form-group small {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.ssh-keys-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ssh-key-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.ssh-key-item:hover {
    background: #f0f1f3;
}

.ssh-key-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ssh-key-info {
    flex: 1;
    min-width: 0;
}

.ssh-key-info h3 {
    color: #212529;
    margin: 0 0 8px 0;
    font-size: 15px;
}

.key-fingerprint,
.key-date {
    color: #666;
    margin: 5px 0;
    font-size: 12px;
}

.fp-label,
.date-icon {
    opacity: 0.7;
}

.fp-value {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #212529;
}

.delete-form {
    display: inline;
}

.action-footer {
    text-align: center;
    padding: 20px;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 30px 20px;
    margin-top: auto;
    text-align: center;
    color: #666;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .ssh-grid {
        grid-template-columns: 1fr;
    }
    
    nav .nav-links {
        gap: 15px;
    }
}

.container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 30px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    animation: slideIn 0.3s ease-out;
}

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

.login-section {
    text-align: center;
}

.login-section h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2d3748;
}

.login-section p {
    color: #718096;
    margin-bottom: 30px;
    font-size: 14px;
}

.login-btn {
    display: inline-block;
    background: #212529;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.login-btn:hover {
    background: #373d42;
    transform: translateY(-2px);
}

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

/* Dashboard Styles */
.dashboard-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dashboard-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
}

.dashboard-header h1 {
    font-size: 26px;
    color: #2d3748;
    margin-bottom: 5px;
}

.user-info {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #212529;
}

.info-item strong {
    color: #2d3748;
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    margin-bottom: 5px;
}

.info-item span {
    color: #2d3748;
    font-size: 16px;
    word-break: break-all;
}

.groups-section h3 {
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 15px;
    margin-top: 25px;
}

.groups-list {
    list-style: none;
}

.groups-list li {
    background: #f8f9fa;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 3px solid #212529;
    color: #212529;
    font-weight: 500;
}

.groups-list li:last-child {
    margin-bottom: 0;
}

.empty-groups {
    background: #fff3cd;
    color: #856404;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.logout-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    text-align: center;
}

.logout-btn {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.logout-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

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

/* Footer */
footer {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 30px 20px;
    margin-top: auto;
    text-align: center;
    color: #666;
    font-size: 14px;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #666;
}

/* SSH Keys Tile */
.ssh-keys-tile {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
    transition: box-shadow 0.2s;
}

.ssh-keys-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tile-header h3 {
    font-size: 18px;
    color: #2d3748;
    margin: 0;
}

.tile-badge {
    background: #212529;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.ssh-keys-tile p {
    color: #666;
    margin: 10px 0 15px 0;
}

.btn-primary {
    display: inline-block;
    background: #212529;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: #373d42;
    transform: translateY(-2px);
}

.btn-secondary {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* SSH Keys Management Page */
.ssh-content {
    max-width: 900px;
    margin: 0 auto;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
}

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

.ssh-form-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.ssh-form-section h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 20px;
}

.ssh-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

.form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.ssh-keys-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
}

.ssh-keys-section h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 20px;
}

.empty-message {
    color: #666;
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 6px;
}

.ssh-keys-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ssh-key-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.ssh-key-item:hover {
    background: #f0f1f3;
}

.ssh-key-info h3 {
    color: #2d3748;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.ssh-key-info p {
    color: #666;
    margin: 5px 0;
    font-size: 13px;
}

.ssh-key-info code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #2d3748;
}
