/*
Theme Name: SafetyHub360
Theme URI: https://safetyhub360.co.uk/
Author: Martin
Author URI: https://safetyhub360.co.uk/
Description: Safety Management CRM for SafetyHub360 - Compliance, Training & Customer Management.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: safetyhub360
*/

/* =============================================================================
   BASE STYLES
   ============================================================================= */

:root {
    --sh-primary: #1976D2;
    --sh-primary-dark: #1565C0;
    --sh-primary-light: #2196F3;
    --sh-accent: #e3f2fd;
    --sh-danger: #e53935;
    --sh-success: #2e7d32;
    --sh-warning: #f57c00;
    --sh-dark: #1a1a1a;
    --sh-text: #333333;
    --sh-text-light: #666666;
    --sh-text-muted: #999999;
    --sh-border: #e0e0e0;
    --sh-bg: #f5f7fa;
    --sh-white: #ffffff;
    --sh-radius: 12px;
    --sh-radius-sm: 8px;
    --sh-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --sh-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--sh-bg);
    color: var(--sh-text);
    line-height: 1.6;
    font-size: 15px;
}

a {
    color: var(--sh-primary);
    text-decoration: none;
}

a:hover {
    color: var(--sh-primary-dark);
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--sh-dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--sh-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sh-primary) 0%, var(--sh-primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--sh-primary-dark) 0%, var(--sh-primary) 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-secondary {
    background: var(--sh-white);
    color: var(--sh-text);
    border: 1px solid var(--sh-border);
}

.btn-secondary:hover {
    background: var(--sh-bg);
    border-color: var(--sh-primary);
    color: var(--sh-primary);
}

.btn-danger {
    background: var(--sh-danger);
    color: white;
}

.btn-danger:hover {
    background: #c62828;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* =============================================================================
   FORMS
   ============================================================================= */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--sh-text);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-size: 0.9rem;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius-sm);
    background: var(--sh-white);
    color: var(--sh-text);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-control::placeholder {
    color: var(--sh-text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
    background: var(--sh-white);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--sh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sh-dark);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--sh-border);
    background: var(--sh-bg);
}

/* =============================================================================
   TABLES
   ============================================================================= */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--sh-border);
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sh-text-light);
    background: var(--sh-bg);
}

.table tbody tr:hover {
    background: var(--sh-accent);
}

.table tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

/* =============================================================================
   BADGES
   ============================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.badge-success {
    background: #e8f5e9;
    color: var(--sh-success);
}

.badge-warning {
    background: #fff3e0;
    color: var(--sh-warning);
}

.badge-danger {
    background: #ffebee;
    color: var(--sh-danger);
}

.badge-primary {
    background: var(--sh-accent);
    color: var(--sh-primary);
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--sh-text-muted); }
.text-primary { color: var(--sh-primary); }
.text-success { color: var(--sh-success); }
.text-danger { color: var(--sh-danger); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }

/* =============================================================================
   LOADING SPINNER
   ============================================================================= */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--sh-border);
    border-top-color: var(--sh-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--sh-dark);
    color: white;
    border-radius: var(--sh-radius-sm);
    box-shadow: var(--sh-shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--sh-success);
}

.toast.error {
    background: var(--sh-danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}